Sync with trunk r63174.

CORE-8176 #resolve #comment Trunk commit r63174 should fix this issue. I merged from trunk to bring it into Shell-experiments.

svn path=/branches/shell-experiments/; revision=63175
This commit is contained in:
David Quintana 2014-05-06 15:51:24 +00:00
commit 057a69972f
323 changed files with 17885 additions and 12574 deletions

View file

@ -58,7 +58,6 @@ VOID Usage(VOID)
int _tmain (int argc, TCHAR *argv[]) int _tmain (int argc, TCHAR *argv[])
{ {
INT i; INT i;
INT LineLen1, LineLen2;
FILE *fp1, *fp2; // file pointers FILE *fp1, *fp2; // file pointers
PTCHAR Line1 = (TCHAR *)malloc(STRBUF * sizeof(TCHAR)); PTCHAR Line1 = (TCHAR *)malloc(STRBUF * sizeof(TCHAR));
PTCHAR Line2 = (TCHAR *)malloc(STRBUF * sizeof(TCHAR)); PTCHAR Line2 = (TCHAR *)malloc(STRBUF * sizeof(TCHAR));
@ -156,8 +155,8 @@ int _tmain (int argc, TCHAR *argv[])
_tprintf(_T("Comparing %s and %s...\n"), File1, File2); _tprintf(_T("Comparing %s and %s...\n"), File1, File2);
while ((LineLen1 = GetLine(Line1, fp1) != 0) && while ((GetLine(Line1, fp1) != 0) &&
(LineLen2 = GetLine(Line2, fp2) != 0)) (GetLine(Line2, fp2) != 0))
{ {
// LineCount++; // LineCount++;
while ((*Line1 != '\0') && (*Line2 != '\0')) while ((*Line1 != '\0') && (*Line2 != '\0'))

View file

@ -125,11 +125,12 @@ find_str (char *sz, FILE *p, int invert_search,
void void
usage (void) usage (void)
{ {
TCHAR lpUsage[4096]; WCHAR wszUsage[4096];
char oemUsage[4096];
LoadString( GetModuleHandle(NULL), IDS_USAGE, (LPTSTR)lpUsage, 4096); LoadStringW (GetModuleHandleW (NULL), IDS_USAGE, wszUsage, sizeof(wszUsage) / sizeof(wszUsage[0]));
CharToOem(lpUsage, lpUsage); CharToOemW (wszUsage, oemUsage);
printf( lpUsage ); fputs (oemUsage, stdout);
} }
@ -139,7 +140,8 @@ main (int argc, char **argv)
{ {
char *opt, *needle = NULL; char *opt, *needle = NULL;
int ret = 0; int ret = 0;
TCHAR lpMessage[4096]; WCHAR wszMessage[4096];
char oemMessage[4096];
int invert_search = 0; /* flag to invert the search */ int invert_search = 0; /* flag to invert the search */
int count_lines = 0; /* flag to whether/not count lines */ int count_lines = 0; /* flag to whether/not count lines */
@ -216,9 +218,9 @@ main (int argc, char **argv)
{ {
/* We were not able to find a file. Display a message and /* We were not able to find a file. Display a message and
set the exit status. */ set the exit status. */
LoadString( GetModuleHandle(NULL), IDS_NO_SUCH_FILE, (LPTSTR)lpMessage, 4096); LoadStringW (GetModuleHandleW (NULL), IDS_NO_SUCH_FILE, wszMessage, sizeof(wszMessage) / sizeof(wszMessage[0]));
CharToOem(lpMessage, lpMessage); CharToOemW (wszMessage, oemMessage);
fprintf (stderr, lpMessage, *argv);// fprintf (stderr, oemMessage, *argv);
} }
else else
{ {
@ -235,9 +237,9 @@ main (int argc, char **argv)
} }
else else
{ {
LoadString(GetModuleHandle(NULL), IDS_CANNOT_OPEN, (LPTSTR)lpMessage, 4096); LoadStringW (GetModuleHandleW (NULL), IDS_CANNOT_OPEN, wszMessage, sizeof(wszMessage) / sizeof(wszMessage[0]));
CharToOem(lpMessage, lpMessage); CharToOemW (wszMessage, oemMessage);
fprintf (stderr, lpMessage, fprintf (stderr, oemMessage,
finddata.name); finddata.name);
} }
} }

View file

@ -112,7 +112,7 @@ ShowMCIError(HWND hwnd, DWORD dwError)
LoadString(hInstance, IDS_DEFAULTMCIERRMSG, szErrorMessage, sizeof(szErrorMessage) / sizeof(TCHAR)); LoadString(hInstance, IDS_DEFAULTMCIERRMSG, szErrorMessage, sizeof(szErrorMessage) / sizeof(TCHAR));
} }
_stprintf(szTempMessage, _T("MMSYS%u: %s"), dwError, szErrorMessage); _stprintf(szTempMessage, _T("MMSYS%lu: %s"), dwError, szErrorMessage);
MessageBox(hwnd, szTempMessage, szAppTitle, MB_OK | MB_ICONEXCLAMATION); MessageBox(hwnd, szTempMessage, szAppTitle, MB_OK | MB_ICONEXCLAMATION);
} }

View file

@ -268,7 +268,7 @@ UpdateViewMenu(PMAIN_WND_INFO Info)
CheckMenuItem(hMenu, CheckMenuItem(hMenu,
IDC_SHOWHIDDEN, IDC_SHOWHIDDEN,
MF_BYCOMMAND | (Info->bShowHidden) ? MF_CHECKED : MF_UNCHECKED); MF_BYCOMMAND | (Info->bShowHidden ? MF_CHECKED : MF_UNCHECKED));
} }
@ -304,7 +304,7 @@ InitMainWnd(PMAIN_WND_INFO Info)
0); 0);
SetMenuDefaultItem(Info->hShortcutMenu, IDC_PROP, FALSE); SetMenuDefaultItem(Info->hShortcutMenu, IDC_PROP, FALSE);
/* create seperate thread to emum devices */ /* create separate thread to emum devices */
DevEnumThread = CreateThread(NULL, DevEnumThread = CreateThread(NULL,
0, 0,
DeviceEnumThread, DeviceEnumThread,
@ -418,6 +418,23 @@ OnNotify(PMAIN_WND_INFO Info,
} }
break; break;
case NM_RETURN:
{
HTREEITEM hSelected = TreeView_GetSelection(Info->hTreeView);
if (Info->Display == DevicesByType)
{
OpenPropSheet(Info->hTreeView, hSelected);
}
else if (Info->Display == DevicesByConnection)
{
if (hSelected != TreeView_GetRoot(Info->hTreeView))
{
OpenPropSheet(Info->hTreeView, hSelected);
}
}
}
break;
case NM_DBLCLK: case NM_DBLCLK:
{ {
HTREEITEM hSelected = TreeView_GetSelection(Info->hTreeView); HTREEITEM hSelected = TreeView_GetSelection(Info->hTreeView);

View file

@ -261,18 +261,11 @@ GetEventCategory(IN LPCWSTR KeyName,
EVENT_MESSAGE_FILE_BUFFER, EVENT_MESSAGE_FILE_BUFFER,
NULL) != 0) NULL) != 0)
{ {
if (lpMsgBuf) /* Trim the string */
{ TrimNulls(lpMsgBuf);
/* Trim the string */
TrimNulls((LPWSTR)lpMsgBuf);
/* Copy the category name */ /* Copy the category name */
wcscpy(CategoryName, (LPCWSTR)lpMsgBuf); wcscpy(CategoryName, lpMsgBuf);
}
else
{
wcscpy(CategoryName, (LPCWSTR)lpMsgBuf);
}
} }
else else
{ {
@ -1118,14 +1111,14 @@ DisplayEvent(HWND hDlg)
if (iIndex != -1) if (iIndex != -1)
{ {
ListView_GetItemText(hwndListView, iIndex, 0, szEventType, sizeof(szEventType) * sizeof(WCHAR)); ListView_GetItemText(hwndListView, iIndex, 0, szEventType, sizeof(szEventType) / sizeof(WCHAR));
ListView_GetItemText(hwndListView, iIndex, 1, szDate, sizeof(szDate) * sizeof(WCHAR)); ListView_GetItemText(hwndListView, iIndex, 1, szDate, sizeof(szDate) / sizeof(WCHAR));
ListView_GetItemText(hwndListView, iIndex, 2, szTime, sizeof(szTime) * sizeof(WCHAR)); ListView_GetItemText(hwndListView, iIndex, 2, szTime, sizeof(szTime) / sizeof(WCHAR));
ListView_GetItemText(hwndListView, iIndex, 3, szSource, sizeof(szSource) * sizeof(WCHAR)); ListView_GetItemText(hwndListView, iIndex, 3, szSource, sizeof(szSource) / sizeof(WCHAR));
ListView_GetItemText(hwndListView, iIndex, 4, szCategory, sizeof(szCategory) * sizeof(WCHAR)); ListView_GetItemText(hwndListView, iIndex, 4, szCategory, sizeof(szCategory) / sizeof(WCHAR));
ListView_GetItemText(hwndListView, iIndex, 5, szEventID, sizeof(szEventID) * sizeof(WCHAR)); ListView_GetItemText(hwndListView, iIndex, 5, szEventID, sizeof(szEventID) / sizeof(WCHAR));
ListView_GetItemText(hwndListView, iIndex, 6, szUser, sizeof(szUser) * sizeof(WCHAR)); ListView_GetItemText(hwndListView, iIndex, 6, szUser, sizeof(szUser) / sizeof(WCHAR));
ListView_GetItemText(hwndListView, iIndex, 7, szComputer, sizeof(szComputer) * sizeof(WCHAR)); ListView_GetItemText(hwndListView, iIndex, 7, szComputer, sizeof(szComputer) / sizeof(WCHAR));
bEventData = !(pevlr->DataLength == 0); bEventData = !(pevlr->DataLength == 0);

View file

@ -31,8 +31,8 @@ SetWallpaper(TCHAR * FileName, DWORD dwStyle, DWORD dwTile) //FIXME: Has to be c
RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName, RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName,
_tcslen(FileName) * sizeof(TCHAR)); _tcslen(FileName) * sizeof(TCHAR));
_stprintf(szStyle, _T("%i"), dwStyle); _stprintf(szStyle, _T("%lu"), dwStyle);
_stprintf(szTile, _T("%i"), dwTile); _stprintf(szTile, _T("%lu"), dwTile);
RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle, RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle,
_tcslen(szStyle) * sizeof(TCHAR)); _tcslen(szStyle) * sizeof(TCHAR));

View file

@ -595,7 +595,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if (!drawing) if (!drawing)
{ {
TCHAR coordStr[100]; TCHAR coordStr[100];
_stprintf(coordStr, _T("%d, %d"), xNow, yNow); _stprintf(coordStr, _T("%ld, %ld"), xNow, yNow);
SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM) coordStr); SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM) coordStr);
} }
} }
@ -634,7 +634,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case TOOL_SHAPE: case TOOL_SHAPE:
{ {
TCHAR coordStr[100]; TCHAR coordStr[100];
_stprintf(coordStr, _T("%d, %d"), xNow, yNow); _stprintf(coordStr, _T("%ld, %ld"), xNow, yNow);
SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM) coordStr); SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM) coordStr);
break; break;
} }
@ -648,7 +648,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
TCHAR sizeStr[100]; TCHAR sizeStr[100];
if ((activeTool >= TOOL_LINE) && (GetAsyncKeyState(VK_SHIFT) < 0)) if ((activeTool >= TOOL_LINE) && (GetAsyncKeyState(VK_SHIFT) < 0))
yRel = xRel; yRel = xRel;
_stprintf(sizeStr, _T("%d x %d"), xRel, yRel); _stprintf(sizeStr, _T("%ld x %ld"), xRel, yRel);
SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) sizeStr); SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) sizeStr);
} }
} }
@ -661,7 +661,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
TCHAR sizeStr[100]; TCHAR sizeStr[100];
if ((activeTool >= TOOL_LINE) && (GetAsyncKeyState(VK_SHIFT) < 0)) if ((activeTool >= TOOL_LINE) && (GetAsyncKeyState(VK_SHIFT) < 0))
yRel = xRel; yRel = xRel;
_stprintf(sizeStr, _T("%d x %d"), xRel, yRel); _stprintf(sizeStr, _T("%ld x %ld"), xRel, yRel);
SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) sizeStr); SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) sizeStr);
} }
} }

View file

@ -225,7 +225,7 @@ CBindStatusCallback_OnProgress(IBindStatusCallback *iface,
if (This->szMimeType[0] != _T('\0')) if (This->szMimeType[0] != _T('\0'))
_tprintf(_T("Length: %I64u [%s]\n"), This->Size, This->szMimeType); _tprintf(_T("Length: %I64u [%s]\n"), This->Size, This->szMimeType);
else else
_tprintf(_T("Length: %ull\n"), This->Size); _tprintf(_T("Length: %I64u\n"), This->Size);
} }
_tprintf(_T("\n")); _tprintf(_T("\n"));

View file

@ -1303,13 +1303,13 @@ void shell(int argc, const char *argv[])
if (argc > 1) if (argc > 1)
{ {
strncat(CmdLine, " /C", MAX_PATH); strncat(CmdLine, " /C", MAX_PATH - strlen(CmdLine) - 1);
} }
for (i=1; i<argc; i++) for (i=1; i<argc; i++)
{ {
strncat(CmdLine, " ", MAX_PATH); strncat(CmdLine, " ", MAX_PATH - strlen(CmdLine) - 1);
strncat(CmdLine, argv[i], MAX_PATH); strncat(CmdLine, argv[i], MAX_PATH - strlen(CmdLine) - 1);
} }
StartupInfo.cb = sizeof( StartupInfo ); StartupInfo.cb = sizeof( StartupInfo );

View file

@ -333,8 +333,8 @@ LPTSTR GetConnectionDescription(LPTSTR lpClass)
(PBYTE)lpKeyClass, (PBYTE)lpKeyClass,
&dwDataSize) != ERROR_SUCCESS) &dwDataSize) != ERROR_SUCCESS)
{ {
lpKeyClass = NULL;
HeapFree(ProcessHeap, 0, lpKeyClass); HeapFree(ProcessHeap, 0, lpKeyClass);
lpKeyClass = NULL;
continue; continue;
} }
} }

View file

@ -709,7 +709,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd)
case 'n': case 'n':
if (iCurrentParam == 1 && iParam[0]==5) { if (iCurrentParam == 1 && iParam[0]==5) {
// report the cursor position // report the cursor position
Network.WriteString("\x1B[0n", 6); Network.WriteString("\x1B[0n", 4);
break; break;
} }
if (iCurrentParam == 1 && iParam[0]==6){ if (iCurrentParam == 1 && iParam[0]==6){

View file

@ -965,7 +965,7 @@ static INT_PTR CALLBACK DIALOG_GoTo_DialogProc(HWND hwndDialog, UINT uMsg, WPARA
switch(uMsg) { switch(uMsg) {
case WM_INITDIALOG: case WM_INITDIALOG:
hTextBox = GetDlgItem(hwndDialog, ID_LINENUMBER); hTextBox = GetDlgItem(hwndDialog, ID_LINENUMBER);
_sntprintf(szText, SIZEOF(szText), _T("%d"), lParam); _sntprintf(szText, SIZEOF(szText), _T("%ld"), lParam);
SetWindowText(hTextBox, szText); SetWindowText(hTextBox, szText);
break; break;
case WM_COMMAND: case WM_COMMAND:

View file

@ -179,12 +179,16 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
if (!GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_ILANGUAGE, if (!GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_ILANGUAGE,
szLocale, sizeof(szLocale) / sizeof(WCHAR))) szLocale, sizeof(szLocale) / sizeof(WCHAR)))
{ {
FindClose(hFind);
return FALSE; return FALSE;
} }
hr = StringCbCatW(szSectionLocale, sizeof(szSectionLocale), szLocale); hr = StringCbCatW(szSectionLocale, sizeof(szSectionLocale), szLocale);
if (FAILED(hr)) if (FAILED(hr))
{
FindClose(hFind);
return FALSE; return FALSE;
}
#define GET_STRING1(a, b) \ #define GET_STRING1(a, b) \
if (!ParserGetString(szSectionLocale, a, b, MAX_PATH, FindFileData.cFileName)) \ if (!ParserGetString(szSectionLocale, a, b, MAX_PATH, FindFileData.cFileName)) \

View file

@ -205,7 +205,7 @@ static
DWORD WINAPI DWORD WINAPI
ThreadFunc(LPVOID Context) ThreadFunc(LPVOID Context)
{ {
IBindStatusCallback *dl; IBindStatusCallback *dl = NULL;
WCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
LPWSTR p; LPWSTR p;
HWND Dlg = (HWND) Context; HWND Dlg = (HWND) Context;
@ -217,7 +217,7 @@ ThreadFunc(LPVOID Context)
BOOL bCab = FALSE; BOOL bCab = FALSE;
HINTERNET hOpen = NULL; HINTERNET hOpen = NULL;
HINTERNET hFile = NULL; HINTERNET hFile = NULL;
HANDLE hOut = NULL; HANDLE hOut = INVALID_HANDLE_VALUE;
unsigned char lpBuffer[4096]; unsigned char lpBuffer[4096];
const LPWSTR lpszAgent = L"RApps/1.0"; const LPWSTR lpszAgent = L"RApps/1.0";
@ -262,6 +262,7 @@ ThreadFunc(LPVOID Context)
/* download it */ /* download it */
bTempfile = TRUE; bTempfile = TRUE;
dl = CreateDl(Context, &bCancelled); dl = CreateDl(Context, &bCancelled);
if (dl == NULL) goto end;
hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (!hOpen) goto end; if (!hOpen) goto end;
@ -284,7 +285,8 @@ ThreadFunc(LPVOID Context)
while (dwBytesRead); while (dwBytesRead);
CloseHandle(hOut); CloseHandle(hOut);
if (dl) IBindStatusCallback_Release(dl); hOut = INVALID_HANDLE_VALUE;
if (bCancelled) goto end; if (bCancelled) goto end;
ShowWindow(Dlg, SW_HIDE); ShowWindow(Dlg, SW_HIDE);
@ -295,10 +297,12 @@ ThreadFunc(LPVOID Context)
ShellExecuteW( NULL, L"open", path, NULL, NULL, SW_SHOWNORMAL ); ShellExecuteW( NULL, L"open", path, NULL, NULL, SW_SHOWNORMAL );
} }
end: end:
CloseHandle(hOut); if (hOut != INVALID_HANDLE_VALUE) CloseHandle(hOut);
InternetCloseHandle(hFile); InternetCloseHandle(hFile);
InternetCloseHandle(hOpen); InternetCloseHandle(hOpen);
if (dl) IBindStatusCallback_Release(dl);
if (bTempfile) if (bTempfile)
{ {
if (bCancelled || (SettingsInfo.bDelInstaller && !bCab)) if (bCancelled || (SettingsInfo.bDelInstaller && !bCab))

View file

@ -893,7 +893,7 @@ static void REGPROC_print_error(void)
status = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, status = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, error_code, 0, (LPSTR) &lpMsgBuf, 0, NULL); NULL, error_code, 0, (LPSTR) &lpMsgBuf, 0, NULL);
if (!status) { if (!status) {
fprintf(stderr,"%S: Cannot display message for error %ld, status %ld\n", fprintf(stderr,"%S: Cannot display message for error %lu, status %lu\n",
getAppName(), error_code, GetLastError()); getAppName(), error_code, GetLastError());
exit(1); exit(1);
} }

View file

@ -1049,7 +1049,7 @@ static BOOL HLPFILE_RtfAddMetaFile(struct RtfData* rd, HLPFILE* file, const
ptr = beg + 2; /* for type and pack */ ptr = beg + 2; /* for type and pack */
mm = fetch_ushort(&ptr); /* mapping mode */ mm = fetch_ushort(&ptr); /* mapping mode */
sprintf(tmp, "{\\pict\\wmetafile%d\\picw%d\\pich%d", sprintf(tmp, "{\\pict\\wmetafile%u\\picw%u\\pich%u",
mm, GET_USHORT(ptr, 0), GET_USHORT(ptr, 2)); mm, GET_USHORT(ptr, 0), GET_USHORT(ptr, 2));
if (!HLPFILE_RtfAddControl(rd, tmp)) return FALSE; if (!HLPFILE_RtfAddControl(rd, tmp)) return FALSE;
ptr += 4; ptr += 4;
@ -1465,11 +1465,10 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
} }
/* FIXME: missing at least colors, also bold attribute looses information */ /* FIXME: missing at least colors, also bold attribute looses information */
sprintf(tmp, "\\f%d\\cf%d\\fs%d%s%s%s%s", sprintf(tmp, "\\f%u\\cf%u\\fs%u%s%s%s%s",
font, font + 2, fs, font, font + 2, fs,
page->file->fonts[font].LogFont.lfWeight > 400 ? "\\b" : "\\b0", page->file->fonts[font].LogFont.lfWeight > 400 ? "\\b" : "\\b0",
page->file->fonts[font].LogFont.lfItalic ? "\\i" : "\\i0", page->file->fonts[font].LogFont.lfItalic ? "\\i" : "\\i0", page->file->fonts[font].LogFont.lfUnderline ? "\\ul" : "\\ul0",
page->file->fonts[font].LogFont.lfUnderline ? "\\ul" : "\\ul0",
page->file->fonts[font].LogFont.lfStrikeOut ? "\\strike" : "\\strike0"); page->file->fonts[font].LogFont.lfStrikeOut ? "\\strike" : "\\strike0");
if (!HLPFILE_RtfAddControl(rd, tmp)) goto done; if (!HLPFILE_RtfAddControl(rd, tmp)) goto done;
} }

View file

@ -1,6 +1,5 @@
add_executable(winver winver.c winver.rc)
add_executable(winver winver.c)
set_module_type(winver win32gui UNICODE) set_module_type(winver win32gui UNICODE)
add_importlibs(winver shell32 msvcrt kernel32) add_importlibs(winver shell32 msvcrt kernel32)
add_cd_file(TARGET winver DESTINATION reactos/system32 FOR all) add_cd_file(TARGET winver DESTINATION reactos/system32 FOR all)

View file

@ -1,3 +1,9 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Version Program
* FILE: winver.c
*/
#include <stdarg.h> #include <stdarg.h>
#include <windef.h> #include <windef.h>
#include <winbase.h> #include <winbase.h>
@ -5,11 +11,10 @@
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{ {
static const WCHAR szROS[] = { 'R','e','a','c','t','O','S',0 }; UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(lpCmdLine); UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(nCmdShow); UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(nCmdShow);
UNREFERENCED_PARAMETER(hInstance);
ShellAboutW(0, szROS, 0, 0); return ShellAboutW(NULL, L"ReactOS", NULL, NULL);
return 1;
} }

View file

@ -0,0 +1,5 @@
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Version Program"
#define REACTOS_STR_INTERNAL_NAME "winver"
#define REACTOS_STR_ORIGINAL_FILENAME "winver.exe"
#include <reactos/version.rc>

View file

@ -1620,7 +1620,7 @@ DWORD PNP_CreateDevInst(
dwInstanceNumber = 0; dwInstanceNumber = 0;
do do
{ {
swprintf(szGeneratedInstance, L"Root\\%ls\\%04d", swprintf(szGeneratedInstance, L"Root\\%ls\\%04lu",
pszDeviceID, dwInstanceNumber); pszDeviceID, dwInstanceNumber);
/* Try to create a device instance with this ID */ /* Try to create a device instance with this ID */
@ -2115,7 +2115,7 @@ DWORD PNP_HwProfFlags(
else else
{ {
swprintf(szKeyName, swprintf(szKeyName,
L"System\\CurrentControlSet\\HardwareProfiles\\%04u\\System\\CurrentControlSet\\Enum", L"System\\CurrentControlSet\\HardwareProfiles\\%04lu\\System\\CurrentControlSet\\Enum",
ulConfig); ulConfig);
} }

View file

@ -461,7 +461,7 @@ AddKbLayoutsToRegistry(IN const MUI_LAYOUTS * MuiLayouts)
} }
else else
{ {
swprintf(szLangID, L"d%03u%s", uCount, MuiLayouts[uIndex].LangID); swprintf(szLangID, L"d%03lu%s", uCount, MuiLayouts[uIndex].LangID);
Status = NtSetValueKey(KeyHandle, Status = NtSetValueKey(KeyHandle,
&ValueName, &ValueName,
0, 0,

File diff suppressed because it is too large Load diff

View file

@ -30,116 +30,116 @@
typedef enum _FORMATSTATE typedef enum _FORMATSTATE
{ {
Unformatted, Unformatted,
UnformattedOrDamaged, UnformattedOrDamaged,
UnknownFormat, UnknownFormat,
Preformatted, Preformatted,
Formatted Formatted
} FORMATSTATE, *PFORMATSTATE; } FORMATSTATE, *PFORMATSTATE;
typedef struct _PARTENTRY typedef struct _PARTENTRY
{ {
LIST_ENTRY ListEntry; LIST_ENTRY ListEntry;
CHAR DriveLetter[4]; CHAR DriveLetter[4];
CHAR VolumeLabel[17]; CHAR VolumeLabel[17];
CHAR FileSystemName[9]; CHAR FileSystemName[9];
/* Partition is unused disk space */ /* Partition is unused disk space */
BOOLEAN Unpartitioned; BOOLEAN Unpartitioned;
/* Partition is new. Table does not exist on disk yet */ /* Partition is new. Table does not exist on disk yet */
BOOLEAN New; BOOLEAN New;
/* Partition was created automatically. */ /* Partition was created automatically. */
BOOLEAN AutoCreate; BOOLEAN AutoCreate;
FORMATSTATE FormatState; FORMATSTATE FormatState;
/* /*
* Raw offset and length of the unpartitioned disk space. * Raw offset and length of the unpartitioned disk space.
* Includes the leading, not yet existing, partition table. * Includes the leading, not yet existing, partition table.
*/ */
ULONGLONG UnpartitionedOffset; ULONGLONG UnpartitionedOffset;
ULONGLONG UnpartitionedLength; ULONGLONG UnpartitionedLength;
PARTITION_INFORMATION PartInfo[4]; PARTITION_INFORMATION PartInfo[4];
} PARTENTRY, *PPARTENTRY; } PARTENTRY, *PPARTENTRY;
typedef struct _BIOSDISKENTRY typedef struct _BIOSDISKENTRY
{ {
LIST_ENTRY ListEntry; LIST_ENTRY ListEntry;
ULONG DiskNumber; ULONG DiskNumber;
ULONG Signature; ULONG Signature;
ULONG Checksum; ULONG Checksum;
BOOLEAN Recognized; BOOLEAN Recognized;
CM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry; CM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry;
CM_INT13_DRIVE_PARAMETER Int13DiskData; CM_INT13_DRIVE_PARAMETER Int13DiskData;
} BIOSDISKENTRY, *PBIOSDISKENTRY; } BIOSDISKENTRY, *PBIOSDISKENTRY;
typedef struct _DISKENTRY typedef struct _DISKENTRY
{ {
LIST_ENTRY ListEntry; LIST_ENTRY ListEntry;
ULONGLONG Cylinders; ULONGLONG Cylinders;
ULONGLONG TracksPerCylinder; ULONGLONG TracksPerCylinder;
ULONGLONG SectorsPerTrack; ULONGLONG SectorsPerTrack;
ULONGLONG BytesPerSector; ULONGLONG BytesPerSector;
ULONGLONG DiskSize; ULONGLONG DiskSize;
ULONGLONG CylinderSize; ULONGLONG CylinderSize;
ULONGLONG TrackSize; ULONGLONG TrackSize;
BOOLEAN BiosFound; BOOLEAN BiosFound;
ULONG BiosDiskNumber; ULONG BiosDiskNumber;
ULONG Signature; ULONG Signature;
ULONG Checksum; ULONG Checksum;
ULONG DiskNumber; ULONG DiskNumber;
USHORT Port; USHORT Port;
USHORT Bus; USHORT Bus;
USHORT Id; USHORT Id;
/* Has the partition list been modified? */ /* Has the partition list been modified? */
BOOLEAN Modified; BOOLEAN Modified;
BOOLEAN NewDisk; BOOLEAN NewDisk;
BOOLEAN NoMbr; /* MBR is absent */ BOOLEAN NoMbr; /* MBR is absent */
UNICODE_STRING DriverName; UNICODE_STRING DriverName;
LIST_ENTRY PartListHead; LIST_ENTRY PartListHead;
} DISKENTRY, *PDISKENTRY; } DISKENTRY, *PDISKENTRY;
typedef struct _PARTLIST typedef struct _PARTLIST
{ {
SHORT Left; SHORT Left;
SHORT Top; SHORT Top;
SHORT Right; SHORT Right;
SHORT Bottom; SHORT Bottom;
SHORT Line; SHORT Line;
SHORT Offset; SHORT Offset;
ULONG TopDisk; ULONG TopDisk;
ULONG TopPartition; ULONG TopPartition;
PDISKENTRY CurrentDisk; PDISKENTRY CurrentDisk;
PPARTENTRY CurrentPartition; PPARTENTRY CurrentPartition;
UCHAR CurrentPartitionNumber; UCHAR CurrentPartitionNumber;
PDISKENTRY ActiveBootDisk; PDISKENTRY ActiveBootDisk;
PPARTENTRY ActiveBootPartition; PPARTENTRY ActiveBootPartition;
UCHAR ActiveBootPartitionNumber; UCHAR ActiveBootPartitionNumber;
LIST_ENTRY DiskListHead; LIST_ENTRY DiskListHead;
LIST_ENTRY BiosDiskListHead; LIST_ENTRY BiosDiskListHead;
} PARTLIST, *PPARTLIST; } PARTLIST, *PPARTLIST;
@ -149,76 +149,90 @@ typedef struct _PARTLIST
typedef struct _PARTITION typedef struct _PARTITION
{ {
unsigned char BootFlags; /* bootable? 0=no, 128=yes */ unsigned char BootFlags; /* bootable? 0=no, 128=yes */
unsigned char StartingHead; /* beginning head number */ unsigned char StartingHead; /* beginning head number */
unsigned char StartingSector; /* beginning sector number */ unsigned char StartingSector; /* beginning sector number */
unsigned char StartingCylinder; /* 10 bit nmbr, with high 2 bits put in begsect */ unsigned char StartingCylinder; /* 10 bit nmbr, with high 2 bits put in begsect */
unsigned char PartitionType; /* Operating System type indicator code */ unsigned char PartitionType; /* Operating System type indicator code */
unsigned char EndingHead; /* ending head number */ unsigned char EndingHead; /* ending head number */
unsigned char EndingSector; /* ending sector number */ unsigned char EndingSector; /* ending sector number */
unsigned char EndingCylinder; /* also a 10 bit nmbr, with same high 2 bit trick */ unsigned char EndingCylinder; /* also a 10 bit nmbr, with same high 2 bit trick */
unsigned int StartingBlock; /* first sector relative to start of disk */ unsigned int StartingBlock; /* first sector relative to start of disk */
unsigned int SectorCount; /* number of sectors in partition */ unsigned int SectorCount; /* number of sectors in partition */
} PARTITION, *PPARTITION; } PARTITION, *PPARTITION;
typedef struct _PARTITION_SECTOR typedef struct _PARTITION_SECTOR
{ {
UCHAR BootCode[440]; /* 0x000 */ UCHAR BootCode[440]; /* 0x000 */
ULONG Signature; /* 0x1B8 */ ULONG Signature; /* 0x1B8 */
UCHAR Reserved[2]; /* 0x1BC */ UCHAR Reserved[2]; /* 0x1BC */
PARTITION Partition[PARTITION_TBL_SIZE]; /* 0x1BE */ PARTITION Partition[PARTITION_TBL_SIZE]; /* 0x1BE */
USHORT Magic; /* 0x1FE */ USHORT Magic; /* 0x1FE */
} PARTITION_SECTOR, *PPARTITION_SECTOR; } PARTITION_SECTOR, *PPARTITION_SECTOR;
#include <poppack.h> #include <poppack.h>
typedef struct typedef struct
{ {
LIST_ENTRY ListEntry; LIST_ENTRY ListEntry;
ULONG DiskNumber; ULONG DiskNumber;
ULONG Idendifier; ULONG Idendifier;
ULONG Signature; ULONG Signature;
} BIOS_DISK, *PBIOS_DISK; } BIOS_DISK, *PBIOS_DISK;
PPARTLIST PPARTLIST
CreatePartitionList (SHORT Left, CreatePartitionList(
SHORT Top, SHORT Left,
SHORT Right, SHORT Top,
SHORT Bottom); SHORT Right,
SHORT Bottom);
VOID VOID
DestroyPartitionList (PPARTLIST List); DestroyPartitionList(
PPARTLIST List);
VOID VOID
DrawPartitionList (PPARTLIST List); DrawPartitionList(
PPARTLIST List);
DWORD DWORD
SelectPartition(PPARTLIST List, ULONG DiskNumber, ULONG PartitionNumber); SelectPartition(
PPARTLIST List,
ULONG DiskNumber,
ULONG PartitionNumber);
BOOL BOOL
SetMountedDeviceValues(PPARTLIST List); SetMountedDeviceValues(
PPARTLIST List);
VOID VOID
ScrollDownPartitionList (PPARTLIST List); ScrollDownPartitionList(
PPARTLIST List);
VOID VOID
ScrollUpPartitionList (PPARTLIST List); ScrollUpPartitionList(
PPARTLIST List);
VOID VOID
CreateNewPartition (PPARTLIST List, CreateNewPartition(
ULONGLONG PartitionSize, PPARTLIST List,
BOOLEAN AutoCreate); ULONGLONG PartitionSize,
BOOLEAN AutoCreate);
VOID VOID
DeleteCurrentPartition (PPARTLIST List); DeleteCurrentPartition(
PPARTLIST List);
VOID VOID
CheckActiveBootPartition (PPARTLIST List); CheckActiveBootPartition(
PPARTLIST List);
BOOLEAN BOOLEAN
CheckForLinuxFdiskPartitions (PPARTLIST List); CheckForLinuxFdiskPartitions(
PPARTLIST List);
BOOLEAN BOOLEAN
WritePartitionsToDisk (PPARTLIST List); WritePartitionsToDisk(
PPARTLIST List);
/* EOF */ /* EOF */

View file

@ -58,7 +58,7 @@ PrintAlias (VOID)
DWORD len; DWORD len;
len = GetConsoleAliasesLength(_T("cmd.exe")); len = GetConsoleAliasesLength(_T("cmd.exe"));
if (len <= 0) if (len == 0)
return; return;
/* allocate memory for an extra \0 char to make parsing easier */ /* allocate memory for an extra \0 char to make parsing easier */

View file

@ -397,13 +397,13 @@ Execute(LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd)
/* build command line for CreateProcess(): FullName + " " + rest */ /* build command line for CreateProcess(): FullName + " " + rest */
BOOL quoted = !!_tcschr(First, ' '); BOOL quoted = !!_tcschr(First, ' ');
_tcscpy(szFullCmdLine, quoted ? _T("\"") : _T("")); _tcscpy(szFullCmdLine, quoted ? _T("\"") : _T(""));
_tcsncat(szFullCmdLine, First, CMDLINE_LENGTH - _tcslen(szFullCmdLine)); _tcsncat(szFullCmdLine, First, CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1);
_tcsncat(szFullCmdLine, quoted ? _T("\"") : _T(""), CMDLINE_LENGTH - _tcslen(szFullCmdLine)); _tcsncat(szFullCmdLine, quoted ? _T("\"") : _T(""), CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1);
if (*rest) if (*rest)
{ {
_tcsncat(szFullCmdLine, _T(" "), CMDLINE_LENGTH - _tcslen(szFullCmdLine)); _tcsncat(szFullCmdLine, _T(" "), CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1);
_tcsncat(szFullCmdLine, rest, CMDLINE_LENGTH - _tcslen(szFullCmdLine)); _tcsncat(szFullCmdLine, rest, CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1);
} }
TRACE ("[EXEC: %s]\n", debugstr_aw(szFullCmdLine)); TRACE ("[EXEC: %s]\n", debugstr_aw(szFullCmdLine));

View file

@ -93,7 +93,7 @@ static BOOL pendingRename()
} }
else else
{ {
printf("Couldn't open key, error %ld\n", res); printf("Couldn't open key, error %lu\n", res);
res=FALSE; res=FALSE;
} }
@ -113,7 +113,7 @@ static BOOL pendingRename()
if (res!=ERROR_SUCCESS) if (res!=ERROR_SUCCESS)
{ {
printf("Couldn't query value's length (%ld)\n", res); printf("Couldn't query value's length (%lu)\n", res);
res=FALSE; res=FALSE;
goto end; goto end;
} }
@ -369,7 +369,7 @@ static BOOL ProcessRunKeys(HKEY hkRoot, LPCWSTR szKeyName, BOOL bDelete,
if ((res=RegEnumValueW(hkRun, i, szValue, &nValLength, 0, &type, if ((res=RegEnumValueW(hkRun, i, szValue, &nValLength, 0, &type,
(LPBYTE)szCmdLine, &nDataLength))!=ERROR_SUCCESS) (LPBYTE)szCmdLine, &nDataLength))!=ERROR_SUCCESS)
{ {
printf("Couldn't read in value %ld - %ld\n", i, res); printf("Couldn't read in value %lu - %ld\n", i, res);
continue; continue;
} }
@ -379,22 +379,22 @@ static BOOL ProcessRunKeys(HKEY hkRoot, LPCWSTR szKeyName, BOOL bDelete,
if (bDelete && (res=RegDeleteValueW(hkRun, szValue))!=ERROR_SUCCESS) if (bDelete && (res=RegDeleteValueW(hkRun, szValue))!=ERROR_SUCCESS)
{ {
printf("Couldn't delete value - %ld, %ld. Running command anyways.\n", i, res); printf("Couldn't delete value - %lu, %ld. Running command anyways.\n", i, res);
} }
if (type!=REG_SZ) if (type!=REG_SZ)
{ {
printf("Incorrect type of value #%ld (%ld)\n", i, type); printf("Incorrect type of value #%lu (%lu)\n", i, type);
continue; continue;
} }
if ((res=runCmd(szCmdLine, NULL, bSynchronous, FALSE))==INVALID_RUNCMD_RETURN) if ((res=runCmd(szCmdLine, NULL, bSynchronous, FALSE))==INVALID_RUNCMD_RETURN)
{ {
printf("Error running cmd #%ld (%ld)\n", i, GetLastError()); printf("Error running cmd #%lu (%ld)\n", i, GetLastError());
} }
printf("Done processing cmd #%ld\n", i); printf("Done processing cmd #%lu\n", i);
} }
free(szValue); free(szValue);

View file

@ -73,7 +73,7 @@ static BOOL UpdateSCMStatus(DWORD dwCurrentState, DWORD dwWin32ExitCode,
static void WINAPI ServiceCtrlHandler(DWORD code) static void WINAPI ServiceCtrlHandler(DWORD code)
{ {
WINE_TRACE("%d\n", code); WINE_TRACE("%u\n", code);
switch (code) switch (code)
{ {
@ -83,7 +83,7 @@ static void WINAPI ServiceCtrlHandler(DWORD code)
KillService(); KillService();
return; return;
default: default:
fprintf(stderr, "Unhandled service control code: %d\n", code); fprintf(stderr, "Unhandled service control code: %u\n", code);
break; break;
} }

View file

@ -99,7 +99,7 @@ ScmCreateNewControlPipe(PSERVICE_IMAGE pServiceImage)
} }
/* Create '\\.\pipe\net\NtControlPipeXXX' instance */ /* Create '\\.\pipe\net\NtControlPipeXXX' instance */
swprintf(szControlPipeName, L"\\\\.\\pipe\\net\\NtControlPipe%u", ServiceCurrent); swprintf(szControlPipeName, L"\\\\.\\pipe\\net\\NtControlPipe%lu", ServiceCurrent);
DPRINT("PipeName: %S\n", szControlPipeName); DPRINT("PipeName: %S\n", szControlPipeName);

View file

@ -115,7 +115,7 @@ LlbHwLoadOsLoaderFromRam(VOID)
/* Set parameters for the OS loader */ /* Set parameters for the OS loader */
snprintf(CommandLine, snprintf(CommandLine,
sizeof(CommandLine), sizeof(CommandLine),
"rdbase=0x%x rdsize=0x%x rdoffset=%s", "rdbase=0x%lx rdsize=0x%lx rdoffset=%s",
RootFs, Size, Offset); RootFs, Size, Offset);
LlbSetCommandLine(CommandLine); LlbSetCommandLine(CommandLine);

View file

@ -1636,7 +1636,8 @@ HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons",,0x00
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu",,0x00000012 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu",,0x00000012
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu","{208D2C60-3AEA-1069-A2D7-08002B30309D}",0x00010001,0x00000000 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu","{208D2C60-3AEA-1069-A2D7-08002B30309D}",0x00010001,0x00000000
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}",,0x00000012 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}",,0x00000012
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","ListviewShadow",0x00010001,0x1 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","ListviewShadow",0x00010001,0x00000001
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","HideFileExt",0x00010001,0x00000000
; default shell ; default shell
HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon",,0x00000012 HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon",,0x00000012

View file

@ -1342,7 +1342,7 @@ HKLM,"SOFTWARE\Microsoft\Ole","EnableRemoteConnect",0x00000000,"N"
; SvcHost services ; SvcHost services
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012 HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost", "netsvcs",0x00010000,"DHCP" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost", "netsvcs",0x00010000,"DHCP","BITS"
; Win32 config ; Win32 config
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows",,0x00000012 HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows",,0x00000012

View file

@ -1304,6 +1304,16 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Beep","ImagePath",0x00020000,"system32\d
HKLM,"SYSTEM\CurrentControlSet\Services\Beep","Start",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\Beep","Start",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\Beep","Type",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\Beep","Type",0x00010001,0x00000001
; Background Intelligent Transfer Service (BITS)
HKLM,"SYSTEM\CurrentControlSet\Services\BITS","DisplayName",0x00000000,"BITS"
HKLM,"SYSTEM\CurrentControlSet\Services\BITS","Description",0x00000000,"Background Intelligent Transfer Service (BITS)"
HKLM,"SYSTEM\CurrentControlSet\Services\BITS","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\BITS","ImagePath",0x00020000,"%SystemRoot%\system32\svchost.exe -k netsvcs"
HKLM,"SYSTEM\CurrentControlSet\Services\BITS","ObjectName",0x00000000,"LocalSystem"
HKLM,"SYSTEM\CurrentControlSet\Services\BITS","Start",0x00010001,0x00000003
HKLM,"SYSTEM\CurrentControlSet\Services\BITS","Type",0x00010001,0x00000020
HKLM,"SYSTEM\CurrentControlSet\Services\BITS\Parameters","ServiceDll",0x00020000,"%SystemRoot%\system32\qmgr.dll"
; BlueScreen device driver ; BlueScreen device driver
HKLM,"SYSTEM\CurrentControlSet\Services\Blue","ErrorControl",0x00010001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\Blue","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\Blue","Group",0x00000000,"Video Init" HKLM,"SYSTEM\CurrentControlSet\Services\Blue","Group",0x00000000,"Video Init"
@ -1393,13 +1403,6 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Fs_Rec","ImagePath",0x00020000,"system32
HKLM,"SYSTEM\CurrentControlSet\Services\Fs_Rec","Start",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\Fs_Rec","Start",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\Fs_Rec","Type",0x00010001,0x00000008 HKLM,"SYSTEM\CurrentControlSet\Services\Fs_Rec","Type",0x00010001,0x00000008
; Kernel-Mode Tests
;HKLM,"SYSTEM\CurrentControlSet\Services\Kmtest","ErrorControl",0x00010001,0x00000000
;HKLM,"SYSTEM\CurrentControlSet\Services\Kmtest","Group",0x00000000,"Base"
;HKLM,"SYSTEM\CurrentControlSet\Services\Kmtest","ImagePath",0x00020000,"system32\drivers\kmtest.sys"
;HKLM,"SYSTEM\CurrentControlSet\Services\Kmtest","Start",0x00010001,0x00000001
;HKLM,"SYSTEM\CurrentControlSet\Services\Kmtest","Type",0x00010001,0x00000001
; Keyboard class driver ; Keyboard class driver
HKLM,"SYSTEM\CurrentControlSet\Services\kbdclass","ErrorControl",0x00010001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\kbdclass","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\kbdclass","Group",0x00000000,"Keyboard Class" HKLM,"SYSTEM\CurrentControlSet\Services\kbdclass","Group",0x00000000,"Keyboard Class"

View file

@ -61,5 +61,5 @@ Signature = "$ReactOS$"
"modules/optional/vmx_mode.dll" 1 optional "modules/optional/vmx_mode.dll" 1 optional
"modules/optional/vmx_svga.inf" 6 optional "modules/optional/vmx_svga.inf" 6 optional
"modules/optional/vmx_svga.sys" 2 optional "modules/optional/vmx_svga.sys" 2 optional
"modules/optional/wine_gecko-2.21-x86.msi" 4 optional "modules/optional/wine_gecko-2.24-x86.msi" 4 optional
"boot/bootdata/bootcdregtest/AHKAppTests.cmd" 7 optional "boot/bootdata/bootcdregtest/AHKAppTests.cmd" 7 optional

View file

@ -170,16 +170,16 @@ FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag)
FrLdrHeapFreeEx(FrLdrDefaultHeap, MemoryPointer, Tag); FrLdrHeapFreeEx(FrLdrDefaultHeap, MemoryPointer, Tag);
} }
PVOID
FORCEINLINE FORCEINLINE
PVOID
FrLdrTempAlloc( FrLdrTempAlloc(
ULONG Size, ULONG Tag) ULONG Size, ULONG Tag)
{ {
return FrLdrHeapAllocateEx(FrLdrTempHeap, Size, Tag); return FrLdrHeapAllocateEx(FrLdrTempHeap, Size, Tag);
} }
VOID
FORCEINLINE FORCEINLINE
VOID
FrLdrTempFree( FrLdrTempFree(
PVOID Allocation, ULONG Tag) PVOID Allocation, ULONG Tag)
{ {

View file

@ -36,6 +36,9 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_flags("-Wno-microsoft") add_compile_flags("-Wno-microsoft")
endif() endif()
if(DBG)
add_compile_flags_language("-Wold-style-declaration -Wdeclaration-after-statement" "C")
endif()
add_compile_flags_language("-fno-rtti -fno-exceptions" "CXX") add_compile_flags_language("-fno-rtti -fno-exceptions" "CXX")
#bug #bug

View file

@ -59,6 +59,6 @@ echo Preparing reactos...
cd ../reactos cd ../reactos
rm -f CMakeCache.txt rm -f CMakeCache.txt
cmake -G "$CMAKE_GENERATOR" -DENABLE_CCACHE:BOOL=1 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-gcc.cmake -DARCH:STRING=$ARCH -DREACTOS_BUILD_TOOLS_DIR:PATH="$REACTOS_BUILD_TOOLS_DIR" $ROS_CMAKEOPTS "$REACTOS_SOURCE_DIR" cmake -G "$CMAKE_GENERATOR" -DENABLE_CCACHE:BOOL=0 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-gcc.cmake -DARCH:STRING=$ARCH -DREACTOS_BUILD_TOOLS_DIR:PATH="$REACTOS_BUILD_TOOLS_DIR" $ROS_CMAKEOPTS "$REACTOS_SOURCE_DIR"
echo Configure script complete! Enter directories and execute appropriate build commands \(ex: ninja, make, makex, etc...\). echo Configure script complete! Enter directories and execute appropriate build commands \(ex: ninja, make, makex, etc...\).

View file

@ -26,11 +26,11 @@
#include <msi.h> #include <msi.h>
#define GECKO_VERSION "2.21" #define GECKO_VERSION "2.24"
#ifdef __i386__ #ifdef __i386__
#define ARCH_STRING "x86" #define ARCH_STRING "x86"
#define GECKO_SHA "a514fc4d53783a586c7880a676c415695fe934a3" #define GECKO_SHA "b4923c0565e6cbd20075a0d4119ce3b48424f962"
#else #else
#define ARCH_STRING "" #define ARCH_STRING ""
#define GECKO_SHA "???" #define GECKO_SHA "???"
@ -60,7 +60,7 @@ static const addon_info_t *addon;
static HWND install_dialog = NULL; static HWND install_dialog = NULL;
static WCHAR GeckoUrl[] = L"http://dl.dropboxusercontent.com/u/743491/ReactOS/wine_gecko-2.21-x86.msi"; static WCHAR GeckoUrl[] = L"http://dl.dropboxusercontent.com/u/743491/ReactOS/wine_gecko-2.24-x86.msi";
/* SHA definitions are copied from advapi32. They aren't available in headers. */ /* SHA definitions are copied from advapi32. They aren't available in headers. */

View file

@ -82,8 +82,8 @@ LdrAlternateResourcesEnabled(VOID)
return FALSE; return FALSE;
} }
ULONG_PTR
FORCEINLINE FORCEINLINE
ULONG_PTR
LdrpMakeCookie(VOID) LdrpMakeCookie(VOID)
{ {
/* Generate a cookie */ /* Generate a cookie */

View file

@ -2054,8 +2054,8 @@ lookinhash:
if (ShowSnaps) if (ShowSnaps)
{ {
DPRINT1("LDR: LdrpCheckForLoadedDll - Unable To Locate %ws: 0x%08x\n", DPRINT1("LDR: LdrpCheckForLoadedDll - Unable To Locate %wZ: 0x%08x\n",
DllName->Buffer, Length); &DllName, Length);
} }
/* Return failure */ /* Return failure */
@ -2333,7 +2333,8 @@ LdrpGetProcedureAddress(IN PVOID BaseAddress,
if (!ExportDir) if (!ExportDir)
{ {
DPRINT1("Image %wZ has no exports, but were trying to get procedure %s. BaseAddress asked %p, got entry BA %p\n", &LdrEntry->BaseDllName, Name ? Name->Buffer : NULL, BaseAddress, LdrEntry->DllBase); DPRINT1("Image %wZ has no exports, but were trying to get procedure %Z. BaseAddress asked 0x%p, got entry BA 0x%p\n",
&LdrEntry->BaseDllName, &Name, BaseAddress, LdrEntry->DllBase);
Status = STATUS_PROCEDURE_NOT_FOUND; Status = STATUS_PROCEDURE_NOT_FOUND;
_SEH2_YIELD(goto Quickie;) _SEH2_YIELD(goto Quickie;)
} }

View file

@ -11,13 +11,18 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
spec2def(atl.dll atl.spec ADD_IMPORTLIB) spec2def(atl.dll atl.spec ADD_IMPORTLIB)
list(APPEND SOURCE list(APPEND SOURCE
atl_main.c atl.c
atl30.c
atl_ax.c
registrar.c
precomp.h
${CMAKE_CURRENT_BINARY_DIR}/atl_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/atl_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/atl.def) ${CMAKE_CURRENT_BINARY_DIR}/atl.def)
add_library(atl SHARED ${SOURCE} rsrc.rc) add_library(atl SHARED ${SOURCE} rsrc.rc)
set_module_type(atl win32dll) set_module_type(atl win32dll)
target_link_libraries(atl uuid wine) target_link_libraries(atl uuid wine)
add_importlibs(atl atl100 atl80 oleaut32 ole32 user32 msvcrt kernel32 ntdll) add_importlibs(atl oleaut32 ole32 user32 gdi32 advapi32 msvcrt kernel32 ntdll)
add_dependencies(atl atl_atliface_header) add_dependencies(atl atl_atliface_header)
add_pch(atl precomp.h SOURCE)
add_cd_file(TARGET atl DESTINATION reactos/system32 FOR all) add_cd_file(TARGET atl DESTINATION reactos/system32 FOR all)

View file

@ -17,11 +17,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "precomp.h" #include <precomp.h>
#include <wingdi.h> #include <wingdi.h>
WINE_DEFAULT_DEBUG_CHANNEL(atl100); #define ATLVer1Size FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer)
HINSTANCE atl_instance;
typedef unsigned char cpp_bool; typedef unsigned char cpp_bool;
@ -296,18 +298,22 @@ HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULE *pM, _ATL_TERMFUNC *pFunc, DWORD
{ {
_ATL_TERMFUNC_ELEM *termfunc_elem; _ATL_TERMFUNC_ELEM *termfunc_elem;
TRACE("(%p %p %ld)\n", pM, pFunc, dw); TRACE("version %04x (%p %p %ld)\n", _ATL_VER, pM, pFunc, dw);
termfunc_elem = HeapAlloc(GetProcessHeap(), 0, sizeof(_ATL_TERMFUNC_ELEM)); if (_ATL_VER > _ATL_VER_30 || pM->cbSize > ATLVer1Size) {
termfunc_elem->pFunc = pFunc; termfunc_elem = HeapAlloc(GetProcessHeap(), 0, sizeof(_ATL_TERMFUNC_ELEM));
termfunc_elem->dw = dw; termfunc_elem->pFunc = pFunc;
termfunc_elem->pNext = pM->m_pTermFuncs; termfunc_elem->dw = dw;
termfunc_elem->pNext = pM->m_pTermFuncs;
pM->m_pTermFuncs = termfunc_elem; pM->m_pTermFuncs = termfunc_elem;
}
return S_OK; return S_OK;
} }
#if _ATL_VER > _ATL_VER_30
/*********************************************************************** /***********************************************************************
* AtlCallTermFunc [atl100.@] * AtlCallTermFunc [atl100.@]
*/ */
@ -327,6 +333,8 @@ void WINAPI AtlCallTermFunc(_ATL_MODULE *pM)
pM->m_pTermFuncs = NULL; pM->m_pTermFuncs = NULL;
} }
#endif
/*********************************************************************** /***********************************************************************
* AtlLoadTypeLib [atl100.56] * AtlLoadTypeLib [atl100.56]
*/ */
@ -383,12 +391,39 @@ HRESULT WINAPI AtlLoadTypeLib(HINSTANCE inst, LPCOLESTR lpszIndex,
return S_OK; return S_OK;
} }
#if _ATL_VER <= _ATL_VER_80
/***********************************************************************
* AtlRegisterTypeLib [atl80.19]
*/
HRESULT WINAPI AtlRegisterTypeLib(HINSTANCE inst, const WCHAR *index)
{
ITypeLib *typelib;
BSTR path;
HRESULT hres;
TRACE("(%p %s)\n", inst, debugstr_w(index));
hres = AtlLoadTypeLib(inst, index, &path, &typelib);
if(FAILED(hres))
return hres;
hres = RegisterTypeLib(typelib, path, NULL); /* FIXME: pass help directory */
ITypeLib_Release(typelib);
SysFreeString(path);
return hres;
}
#endif
#if _ATL_VER > _ATL_VER_30
/*********************************************************************** /***********************************************************************
* AtlWinModuleInit [atl100.65] * AtlWinModuleInit [atl100.65]
*/ */
HRESULT WINAPI AtlWinModuleInit(_ATL_WIN_MODULE *winmod) HRESULT WINAPI AtlWinModuleInit(_ATL_WIN_MODULE *winmod)
{ {
TRACE("(%p\n", winmod); TRACE("(%p)\n", winmod);
if(winmod->cbSize != sizeof(*winmod)) if(winmod->cbSize != sizeof(*winmod))
return E_INVALIDARG; return E_INVALIDARG;
@ -499,7 +534,28 @@ HRESULT WINAPI AtlComModuleRegisterClassObjects(_ATL_COM_MODULE *module, DWORD c
} }
return S_OK; return S_OK;
}
/***********************************************************************
* AtlComModuleRevokeClassObjects [atl100.20]
*/
HRESULT WINAPI AtlComModuleRevokeClassObjects(_ATL_COM_MODULE *module)
{
_ATL_OBJMAP_ENTRY **iter;
HRESULT hres;
TRACE("(%p)\n", module);
if(!module)
return E_INVALIDARG;
for(iter = module->m_ppAutoObjMapFirst; iter < module->m_ppAutoObjMapLast; iter++) {
hres = CoRevokeClassObject((*iter)->dwRegister);
if(FAILED(hres))
return hres;
}
return S_OK;
} }
/*********************************************************************** /***********************************************************************
@ -554,6 +610,8 @@ HRESULT WINAPI AtlComModuleUnregisterServer(_ATL_COM_MODULE *mod, BOOL bRegTypeL
return S_OK; return S_OK;
} }
#endif
/*********************************************************************** /***********************************************************************
* AtlRegisterClassCategoriesHelper [atl100.49] * AtlRegisterClassCategoriesHelper [atl100.49]
*/ */
@ -757,6 +815,8 @@ HRESULT WINAPI AtlGetObjectSourceInterface(IUnknown *unk, GUID *libid, IID *iid,
return hres; return hres;
} }
#if _ATL_VER >= _ATL_VER90
/*********************************************************************** /***********************************************************************
* AtlSetPerUserRegistration [atl100.67] * AtlSetPerUserRegistration [atl100.67]
*/ */
@ -776,12 +836,15 @@ HRESULT WINAPI AtlGetPerUserRegistration(cpp_bool *pbEnabled)
return S_OK; return S_OK;
} }
#endif
/*********************************************************************** /***********************************************************************
* AtlGetVersion [atl100.@] * AtlGetVersion [atl100.@]
*/ */
DWORD WINAPI AtlGetVersion(void *pReserved) DWORD WINAPI AtlGetVersion(void *pReserved)
{ {
return _ATL_VER; TRACE("version %04x (%p)\n", _ATL_VER, pReserved);
return _ATL_VER;
} }
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
@ -790,6 +853,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
switch(fdwReason) { switch(fdwReason) {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
atl_instance = hinstDLL;
DisableThreadLibraryCalls(hinstDLL); DisableThreadLibraryCalls(hinstDLL);
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:

View file

@ -2,11 +2,11 @@
@ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllRegisterServer() @ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer() @ stdcall -private DllUnregisterServer()
10 stdcall AtlAdvise(ptr ptr ptr ptr) atl100.AtlAdvise 10 stdcall AtlAdvise(ptr ptr ptr ptr)
11 stdcall AtlUnadvise(ptr ptr long) atl100.AtlUnadvise 11 stdcall AtlUnadvise(ptr ptr long)
12 stdcall AtlFreeMarshalStream(ptr) atl100.AtlFreeMarshalStream 12 stdcall AtlFreeMarshalStream(ptr)
13 stdcall AtlMarshalPtrInProc(ptr ptr ptr) atl100.AtlMarshalPtrInProc 13 stdcall AtlMarshalPtrInProc(ptr ptr ptr)
14 stdcall AtlUnmarshalPtr(ptr ptr ptr) atl100.AtlUnmarshalPtr 14 stdcall AtlUnmarshalPtr(ptr ptr ptr)
15 stdcall AtlModuleGetClassObject(ptr ptr ptr ptr) 15 stdcall AtlModuleGetClassObject(ptr ptr ptr ptr)
16 stdcall AtlModuleInit(ptr long long) 16 stdcall AtlModuleInit(ptr long long)
17 stdcall AtlModuleRegisterClassObjects(ptr long long) 17 stdcall AtlModuleRegisterClassObjects(ptr long long)
@ -16,36 +16,36 @@
21 stdcall AtlModuleTerm(ptr) 21 stdcall AtlModuleTerm(ptr)
22 stdcall AtlModuleUnregisterServer(ptr ptr) 22 stdcall AtlModuleUnregisterServer(ptr ptr)
23 stdcall AtlModuleUpdateRegistryFromResourceD(ptr wstr long ptr ptr) 23 stdcall AtlModuleUpdateRegistryFromResourceD(ptr wstr long ptr ptr)
24 stdcall AtlWaitWithMessageLoop(long) atl100.AtlWaitWithMessageLoop 24 stdcall AtlWaitWithMessageLoop(long)
25 stub AtlSetErrorInfo 25 stub AtlSetErrorInfo
26 stdcall AtlCreateTargetDC(long ptr) atl100.AtlCreateTargetDC 26 stdcall AtlCreateTargetDC(long ptr)
27 stdcall AtlHiMetricToPixel(ptr ptr) atl100.AtlHiMetricToPixel 27 stdcall AtlHiMetricToPixel(ptr ptr)
28 stdcall AtlPixelToHiMetric(ptr ptr) atl100.AtlPixelToHiMetric 28 stdcall AtlPixelToHiMetric(ptr ptr)
29 stub AtlDevModeW2A 29 stub AtlDevModeW2A
30 stdcall AtlComPtrAssign(ptr ptr) atl100.AtlComPtrAssign 30 stdcall AtlComPtrAssign(ptr ptr)
31 stdcall AtlComQIPtrAssign(ptr ptr ptr) atl100.AtlComQIPtrAssign 31 stdcall AtlComQIPtrAssign(ptr ptr ptr)
32 stdcall AtlInternalQueryInterface(ptr ptr ptr ptr) atl100.AtlInternalQueryInterface 32 stdcall AtlInternalQueryInterface(ptr ptr ptr ptr)
34 stdcall AtlGetVersion(ptr) 34 stdcall AtlGetVersion(ptr)
35 stdcall AtlAxDialogBoxW(long wstr long ptr long) atl100.AtlAxDialogBoxW 35 stdcall AtlAxDialogBoxW(long wstr long ptr long)
36 stdcall AtlAxDialogBoxA(long str long ptr long) atl100.AtlAxDialogBoxA 36 stdcall AtlAxDialogBoxA(long str long ptr long)
37 stdcall AtlAxCreateDialogW(long wstr long ptr long) atl100.AtlAxCreateDialogW 37 stdcall AtlAxCreateDialogW(long wstr long ptr long)
38 stdcall AtlAxCreateDialogA(long str long ptr long) atl100.AtlAxCreateDialogA 38 stdcall AtlAxCreateDialogA(long str long ptr long)
39 stdcall AtlAxCreateControl(ptr ptr ptr ptr) atl100.AtlAxCreateControl 39 stdcall AtlAxCreateControl(ptr ptr ptr ptr)
40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr) atl100.AtlAxCreateControlEx 40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr)
41 stdcall AtlAxAttachControl(ptr ptr ptr) atl100.AtlAxAttachControl 41 stdcall AtlAxAttachControl(ptr ptr ptr)
42 stdcall AtlAxWinInit() 42 stdcall AtlAxWinInit()
43 stdcall AtlModuleAddCreateWndData(ptr ptr ptr) 43 stdcall AtlModuleAddCreateWndData(ptr ptr ptr)
44 stdcall AtlModuleExtractCreateWndData(ptr) 44 stdcall AtlModuleExtractCreateWndData(ptr)
45 stdcall AtlModuleRegisterWndClassInfoW(ptr ptr ptr) 45 stdcall AtlModuleRegisterWndClassInfoW(ptr ptr ptr)
46 stdcall AtlModuleRegisterWndClassInfoA(ptr ptr ptr) 46 stdcall AtlModuleRegisterWndClassInfoA(ptr ptr ptr)
47 stdcall AtlAxGetControl(long ptr) atl100.AtlAxGetControl 47 stdcall AtlAxGetControl(long ptr)
48 stdcall AtlAxGetHost(long ptr) atl100.AtlAxGetHost 48 stdcall AtlAxGetHost(long ptr)
49 stdcall AtlRegisterClassCategoriesHelper(ptr ptr long) atl100.AtlRegisterClassCategoriesHelper 49 stdcall AtlRegisterClassCategoriesHelper(ptr ptr long)
50 stdcall AtlIPersistStreamInit_Load(ptr ptr ptr ptr) atl100.AtlIPersistStreamInit_Load 50 stdcall AtlIPersistStreamInit_Load(ptr ptr ptr ptr)
51 stdcall AtlIPersistStreamInit_Save(ptr long ptr ptr ptr) atl100.AtlIPersistStreamInit_Save 51 stdcall AtlIPersistStreamInit_Save(ptr long ptr ptr ptr)
52 stdcall AtlIPersistPropertyBag_Load(ptr ptr ptr ptr ptr) atl100.AtlIPersistPropertyBag_Load 52 stdcall AtlIPersistPropertyBag_Load(ptr ptr ptr ptr ptr)
53 stub AtlIPersistPropertyBag_Save 53 stub AtlIPersistPropertyBag_Save
54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr) atl100.AtlGetObjectSourceInterface 54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr)
55 stub AtlModuleUnRegisterTypeLib 55 stub AtlModuleUnRegisterTypeLib
56 stdcall AtlModuleLoadTypeLib(ptr wstr ptr ptr) 56 stdcall AtlModuleLoadTypeLib(ptr wstr ptr ptr)
57 stdcall AtlModuleUnregisterServerEx(ptr long ptr) 57 stdcall AtlModuleUnregisterServerEx(ptr long ptr)

View file

@ -19,40 +19,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#define WIN32_NO_STATUS #include <precomp.h>
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <stdio.h> #include <stdio.h>
#include <rpcproxy.h>
#define COBJMACROS extern HINSTANCE atl_instance;
#include <windef.h>
#include <winbase.h>
#include <ole2.h>
#include <oleauto.h>
//#include "objidl.h"
#include <atlbase.h>
#include <atlwin.h>
#include <wine/debug.h>
#include <wine/unicode.h>
WINE_DEFAULT_DEBUG_CHANNEL(atl);
static HINSTANCE hInst;
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("(0x%p, %d, %p)\n",hinstDLL,fdwReason,lpvReserved);
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
hInst = hinstDLL;
}
return TRUE;
}
#define ATLVer1Size FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer) #define ATLVer1Size FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer)
@ -150,25 +122,6 @@ HRESULT WINAPI AtlModuleTerm(_ATL_MODULE *pM)
return S_OK; return S_OK;
} }
HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULEW *pM, _ATL_TERMFUNC *pFunc, DWORD_PTR dw)
{
_ATL_TERMFUNC_ELEM *termfunc_elem;
TRACE("(%p %p %ld)\n", pM, pFunc, dw);
if (pM->cbSize > ATLVer1Size)
{
termfunc_elem = HeapAlloc(GetProcessHeap(), 0, sizeof(_ATL_TERMFUNC_ELEM));
termfunc_elem->pFunc = pFunc;
termfunc_elem->dw = dw;
termfunc_elem->pNext = pM->m_pTermFuncs;
pM->m_pTermFuncs = termfunc_elem;
}
return S_OK;
}
HRESULT WINAPI AtlModuleRegisterClassObjects(_ATL_MODULEW *pM, DWORD dwClsContext, HRESULT WINAPI AtlModuleRegisterClassObjects(_ATL_MODULEW *pM, DWORD dwClsContext,
DWORD dwFlags) DWORD dwFlags)
{ {
@ -602,6 +555,7 @@ static HRESULT do_register_server(BOOL do_register)
return do_register_dll_server(NULL, atl_dllW, MAKEINTRESOURCEW(101), do_register, reg_map); return do_register_dll_server(NULL, atl_dllW, MAKEINTRESOURCEW(101), do_register, reg_map);
} }
/************************************************************** /**************************************************************
* DllGetClassObject (ATL.2) * DllGetClassObject (ATL.2)
*/ */
@ -640,59 +594,3 @@ HRESULT WINAPI DllCanUnloadNow(void)
{ {
return S_FALSE; return S_FALSE;
} }
/***********************************************************************
* AtlGetVersion [ATL.@]
*/
DWORD WINAPI AtlGetVersion(void *pReserved)
{
return _ATL_VER;
}
/**********************************************************************
* AtlAxWin class window procedure
*/
static LRESULT CALLBACK AtlAxWin_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
{
if ( wMsg == WM_CREATE )
{
DWORD len = GetWindowTextLengthW( hWnd ) + 1;
WCHAR *ptr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if (!ptr)
return 1;
GetWindowTextW( hWnd, ptr, len );
AtlAxCreateControlEx( ptr, hWnd, NULL, NULL, NULL, NULL, NULL );
HeapFree( GetProcessHeap(), 0, ptr );
return 0;
}
return DefWindowProcW( hWnd, wMsg, wParam, lParam );
}
BOOL WINAPI AtlAxWinInit(void)
{
WNDCLASSEXW wcex;
const WCHAR AtlAxWin[] = {'A','t','l','A','x','W','i','n',0};
FIXME("semi-stub\n");
if ( FAILED( OleInitialize(NULL) ) )
return FALSE;
wcex.cbSize = sizeof(wcex);
wcex.style = CS_GLOBALCLASS;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = GetModuleHandleW( NULL );
wcex.hIcon = NULL;
wcex.hCursor = NULL;
wcex.hbrBackground = NULL;
wcex.lpszMenuName = NULL;
wcex.hIconSm = 0;
wcex.lpfnWndProc = AtlAxWin_wndproc;
wcex.lpszClassName = AtlAxWin;
if ( !RegisterClassExW( &wcex ) )
return FALSE;
return TRUE;
}

View file

@ -18,13 +18,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "precomp.h" #include <precomp.h>
#include <ole2.h> #include <ole2.h>
#include <exdisp.h> #include <exdisp.h>
#include <atlwin.h> #include <wine/atlwin.h>
WINE_DEFAULT_DEBUG_CHANNEL(atl);
typedef struct IOCS { typedef struct IOCS {
IOleClientSite IOleClientSite_iface; IOleClientSite IOleClientSite_iface;
@ -72,16 +70,30 @@ static LRESULT CALLBACK AtlAxWin_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, L
BOOL WINAPI AtlAxWinInit(void) BOOL WINAPI AtlAxWinInit(void)
{ {
WNDCLASSEXW wcex; WNDCLASSEXW wcex;
const WCHAR AtlAxWin100[] = {'A','t','l','A','x','W','i','n','1','0','0',0};
const WCHAR AtlAxWinLic100[] = {'A','t','l','A','x','W','i','n','L','i','c','1','0','0',0};
FIXME("semi-stub\n"); #if _ATL_VER <= _ATL_VER_30
#define ATL_NAME_SUFFIX 0
#elif _ATL_VER == _ATL_VER_80
#define ATL_NAME_SUFFIX '8','0',0
#elif _ATL_VER == _ATL_VER_90
#define ATL_NAME_SUFFIX '9','0',0
#elif _ATL_VER == _ATL_VER_100
#define ATL_NAME_SUFFIX '1','0','0',0
#elif _ATL_VER == _ATL_VER_110
#define ATL_NAME_SUFFIX '1','1','0',0
#else
#error Unsupported version
#endif
const WCHAR AtlAxWinW[] = {'A','t','l','A','x','W','i','n',ATL_NAME_SUFFIX};
FIXME("version %04x semi-stub\n", _ATL_VER);
if ( FAILED( OleInitialize(NULL) ) ) if ( FAILED( OleInitialize(NULL) ) )
return FALSE; return FALSE;
wcex.cbSize = sizeof(wcex); wcex.cbSize = sizeof(wcex);
wcex.style = CS_GLOBALCLASS | CS_DBLCLKS; wcex.style = CS_GLOBALCLASS | (_ATL_VER > _ATL_VER_30 ? CS_DBLCLKS : 0);
wcex.cbClsExtra = 0; wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0; wcex.cbWndExtra = 0;
wcex.hInstance = GetModuleHandleW( NULL ); wcex.hInstance = GetModuleHandleW( NULL );
@ -92,13 +104,17 @@ BOOL WINAPI AtlAxWinInit(void)
wcex.hIconSm = 0; wcex.hIconSm = 0;
wcex.lpfnWndProc = AtlAxWin_wndproc; wcex.lpfnWndProc = AtlAxWin_wndproc;
wcex.lpszClassName = AtlAxWin100; wcex.lpszClassName = AtlAxWinW;
if ( !RegisterClassExW( &wcex ) ) if ( !RegisterClassExW( &wcex ) )
return FALSE; return FALSE;
wcex.lpszClassName = AtlAxWinLic100; if(_ATL_VER > _ATL_VER_30) {
if ( !RegisterClassExW( &wcex ) ) const WCHAR AtlAxWinLicW[] = {'A','t','l','A','x','W','i','n','L','i','c',ATL_NAME_SUFFIX};
return FALSE;
wcex.lpszClassName = AtlAxWinLicW;
if ( !RegisterClassExW( &wcex ) )
return FALSE;
}
return TRUE; return TRUE;
} }

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#pragma makedep register
[ [
helpstring("Registrar Class"), helpstring("Registrar Class"),
progid("ATL.Registrar"), progid("ATL.Registrar"),

25
dll/win32/atl/precomp.h Normal file
View file

@ -0,0 +1,25 @@
#ifndef _ATL_PCH_
#define _ATL_PCH_
#include <stdarg.h>
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <objbase.h>
#include <oleauto.h>
#include <wine/atlbase.h>
#include <wine/atlwin.h>
#include <wine/debug.h>
#include <wine/unicode.h>
WINE_DEFAULT_DEBUG_CHANNEL(atl);
#endif /* _ATL_PCH_ */

View file

@ -16,9 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "precomp.h" #include <precomp.h>
WINE_DEFAULT_DEBUG_CHANNEL(atl);
/************************************************************** /**************************************************************
* ATLRegistrar implementation * ATLRegistrar implementation
@ -490,15 +488,13 @@ static HRESULT file_register(Registrar *This, LPCOLESTR fileName, BOOL do_regist
DWORD filelen, len; DWORD filelen, len;
LPWSTR regstrw; LPWSTR regstrw;
LPSTR regstra; LPSTR regstra;
LRESULT lres;
HRESULT hres; HRESULT hres;
file = CreateFileW(fileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL); file = CreateFileW(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if(file != INVALID_HANDLE_VALUE) { if(file != INVALID_HANDLE_VALUE) {
filelen = GetFileSize(file, NULL); filelen = GetFileSize(file, NULL);
regstra = HeapAlloc(GetProcessHeap(), 0, filelen); regstra = HeapAlloc(GetProcessHeap(), 0, filelen);
lres = ReadFile(file, regstra, filelen, NULL, NULL); if(ReadFile(file, regstra, filelen, NULL, NULL)) {
if(lres == ERROR_SUCCESS) {
len = MultiByteToWideChar(CP_ACP, 0, regstra, filelen, NULL, 0)+1; len = MultiByteToWideChar(CP_ACP, 0, regstra, filelen, NULL, 0)+1;
regstrw = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR)); regstrw = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, regstra, filelen, regstrw, len); MultiByteToWideChar(CP_ACP, 0, regstra, filelen, regstrw, len);
@ -508,13 +504,13 @@ static HRESULT file_register(Registrar *This, LPCOLESTR fileName, BOOL do_regist
HeapFree(GetProcessHeap(), 0, regstrw); HeapFree(GetProcessHeap(), 0, regstrw);
}else { }else {
WARN("Failed to read faile\n"); WARN("Failed to read file %s\n", debugstr_w(fileName));
hres = HRESULT_FROM_WIN32(lres); hres = HRESULT_FROM_WIN32(GetLastError());
} }
HeapFree(GetProcessHeap(), 0, regstra); HeapFree(GetProcessHeap(), 0, regstra);
CloseHandle(file); CloseHandle(file);
}else { }else {
WARN("Could not open file\n"); WARN("Could not open file %s\n", debugstr_w(fileName));
hres = HRESULT_FROM_WIN32(GetLastError()); hres = HRESULT_FROM_WIN32(GetLastError());
} }

View file

@ -11,9 +11,9 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
spec2def(atl100.dll atl100.spec ADD_IMPORTLIB) spec2def(atl100.dll atl100.spec ADD_IMPORTLIB)
list(APPEND SOURCE list(APPEND SOURCE
atl.c ${REACTOS_SOURCE_DIR}/dll/win32/atl/atl.c
atl_ax.c ${REACTOS_SOURCE_DIR}/dll/win32/atl/atl_ax.c
registrar.c ${REACTOS_SOURCE_DIR}/dll/win32/atl/registrar.c
precomp.h precomp.h
${CMAKE_CURRENT_BINARY_DIR}/atl100_stubs.c) ${CMAKE_CURRENT_BINARY_DIR}/atl100_stubs.c)

View file

@ -5,7 +5,7 @@
14 stdcall AtlUnmarshalPtr(ptr ptr ptr) 14 stdcall AtlUnmarshalPtr(ptr ptr ptr)
15 stdcall AtlComModuleGetClassObject(ptr ptr ptr ptr) 15 stdcall AtlComModuleGetClassObject(ptr ptr ptr ptr)
17 stdcall AtlComModuleRegisterClassObjects(ptr long long) 17 stdcall AtlComModuleRegisterClassObjects(ptr long long)
20 stub AtlComModuleRevokeClassObjects 20 stdcall AtlComModuleRevokeClassObjects(ptr)
22 stdcall AtlComModuleUnregisterServer(ptr long ptr) 22 stdcall AtlComModuleUnregisterServer(ptr long ptr)
23 stdcall AtlUpdateRegistryFromResourceD(long wstr long ptr ptr) 23 stdcall AtlUpdateRegistryFromResourceD(long wstr long ptr ptr)
24 stdcall AtlWaitWithMessageLoop(long) 24 stdcall AtlWaitWithMessageLoop(long)

View file

@ -19,4 +19,6 @@
#include <wine/debug.h> #include <wine/debug.h>
#include <wine/unicode.h> #include <wine/unicode.h>
WINE_DEFAULT_DEBUG_CHANNEL(atl);
#endif /* _ATL100_PCH_ */ #endif /* _ATL100_PCH_ */

View file

@ -3,15 +3,23 @@ add_definitions(
-D__WINESRC__ -D__WINESRC__
-D_ATL_VER=_ATL_VER_80) -D_ATL_VER=_ATL_VER_80)
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
spec2def(atl80.dll atl80.spec ADD_IMPORTLIB) spec2def(atl80.dll atl80.spec ADD_IMPORTLIB)
list(APPEND SOURCE list(APPEND SOURCE
${REACTOS_SOURCE_DIR}/dll/win32/atl/atl.c
atl80.c atl80.c
${REACTOS_SOURCE_DIR}/dll/win32/atl/atl_ax.c
${REACTOS_SOURCE_DIR}/dll/win32/atl/registrar.c
precomp.h
${CMAKE_CURRENT_BINARY_DIR}/atl80_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/atl80_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/atl80.def) ${CMAKE_CURRENT_BINARY_DIR}/atl80.def)
add_library(atl80 SHARED ${SOURCE}) add_library(atl80 SHARED ${SOURCE})
set_module_type(atl80 win32dll) set_module_type(atl80 win32dll)
target_link_libraries(atl80 wine) target_link_libraries(atl80 uuid wine)
add_importlibs(atl80 atl100 oleaut32 user32 ole32 msvcrt kernel32 ntdll) add_importlibs(atl80 oleaut32 user32 ole32 gdi32 advapi32 msvcrt kernel32 ntdll)
add_pch(atl80 precomp.h SOURCE)
add_cd_file(TARGET atl80 DESTINATION reactos/system32 FOR all) add_cd_file(TARGET atl80 DESTINATION reactos/system32 FOR all)

View file

@ -16,21 +16,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <stdarg.h> #include <precomp.h>
#include <stdio.h> #include <stdio.h>
#define COBJMACROS
#include <windef.h>
#include <winbase.h>
#include <winerror.h> #include <winerror.h>
#include <winuser.h> #include <winuser.h>
#include <wine/atlbase.h>
#include <wine/debug.h>
#include <wine/unicode.h>
WINE_DEFAULT_DEBUG_CHANNEL(atl);
/*********************************************************************** /***********************************************************************
* AtlRegisterTypeLib [atl80.18] * AtlRegisterTypeLib [atl80.18]
@ -68,85 +58,3 @@ HRESULT WINAPI AtlComModuleRegisterServer(_ATL_COM_MODULE *mod, BOOL bRegTypeLib
return S_OK; return S_OK;
} }
/***********************************************************************
* AtlRegisterTypeLib [atl80.19]
*/
HRESULT WINAPI AtlRegisterTypeLib(HINSTANCE inst, const WCHAR *index)
{
ITypeLib *typelib;
BSTR path;
HRESULT hres;
TRACE("(%p %s)\n", inst, debugstr_w(index));
hres = AtlLoadTypeLib(inst, index, &path, &typelib);
if(FAILED(hres))
return hres;
hres = RegisterTypeLib(typelib, path, NULL); /* FIXME: pass help directory */
ITypeLib_Release(typelib);
SysFreeString(path);
return hres;
}
/***********************************************************************
* AtlGetVersion [atl80.@]
*/
DWORD WINAPI AtlGetVersion(void *pReserved)
{
return _ATL_VER;
}
/**********************************************************************
* AtlAxWin class window procedure
*/
static LRESULT CALLBACK AtlAxWin_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
{
if ( wMsg == WM_CREATE )
{
DWORD len = GetWindowTextLengthW( hWnd ) + 1;
WCHAR *ptr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if (!ptr)
return 1;
GetWindowTextW( hWnd, ptr, len );
AtlAxCreateControlEx( ptr, hWnd, NULL, NULL, NULL, NULL, NULL );
HeapFree( GetProcessHeap(), 0, ptr );
return 0;
}
return DefWindowProcW( hWnd, wMsg, wParam, lParam );
}
BOOL WINAPI AtlAxWinInit(void)
{
WNDCLASSEXW wcex;
const WCHAR AtlAxWin80[] = {'A','t','l','A','x','W','i','n','8','0',0};
const WCHAR AtlAxWinLic80[] = {'A','t','l','A','x','W','i','n','L','i','c','8','0',0};
FIXME("semi-stub\n");
if ( FAILED( OleInitialize(NULL) ) )
return FALSE;
wcex.cbSize = sizeof(wcex);
wcex.style = CS_GLOBALCLASS | CS_DBLCLKS;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = GetModuleHandleW( NULL );
wcex.hIcon = NULL;
wcex.hCursor = NULL;
wcex.hbrBackground = NULL;
wcex.lpszMenuName = NULL;
wcex.hIconSm = 0;
wcex.lpfnWndProc = AtlAxWin_wndproc;
wcex.lpszClassName = AtlAxWin80;
if ( !RegisterClassExW( &wcex ) )
return FALSE;
wcex.lpszClassName = AtlAxWinLic80;
if ( !RegisterClassExW( &wcex ) )
return FALSE;
return TRUE;
}

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="Microsoft.VC80.ATL" version="8.0.50727.4053" processorArchitecture="" publicKeyToken="1fc8b3b9a1e18e3b"/>
<file name="atl80.dll"/>
</assembly>

22
dll/win32/atl80/atl80.rc Normal file
View file

@ -0,0 +1,22 @@
/*
* Resource file for atl80
*
* Copyright 2011 Alexandre Julliard
*
* 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
*/
/* @makedep: atl80.manifest */
WINE_MANIFEST 24 atl80.manifest

View file

@ -1,53 +1,53 @@
10 stdcall AtlAdvise(ptr ptr ptr ptr) atl100.AtlAdvise 10 stdcall AtlAdvise(ptr ptr ptr ptr)
11 stdcall AtlUnadvise(ptr ptr long) atl100.AtlUnadvise 11 stdcall AtlUnadvise(ptr ptr long)
12 stdcall AtlFreeMarshalStream(ptr) atl100.AtlFreeMarshalStream 12 stdcall AtlFreeMarshalStream(ptr)
13 stdcall AtlMarshalPtrInProc(ptr ptr ptr) atl100.AtlMarshalPtrInProc 13 stdcall AtlMarshalPtrInProc(ptr ptr ptr)
14 stdcall AtlUnmarshalPtr(ptr ptr ptr) atl100.AtlUnmarshalPtr 14 stdcall AtlUnmarshalPtr(ptr ptr ptr)
15 stdcall AtlComModuleGetClassObject(ptr ptr ptr ptr) atl100.AtlComModuleGetClassObject 15 stdcall AtlComModuleGetClassObject(ptr ptr ptr ptr)
17 stdcall AtlComModuleRegisterClassObjects(ptr long long) atl100.AtlComModuleRegisterClassObjects 17 stdcall AtlComModuleRegisterClassObjects(ptr long long)
18 stdcall AtlComModuleRegisterServer(ptr long ptr) 18 stdcall AtlComModuleRegisterServer(ptr long ptr)
19 stdcall AtlRegisterTypeLib(ptr wstr) 19 stdcall AtlRegisterTypeLib(ptr wstr)
20 stub AtlComModuleRevokeClassObjects 20 stdcall AtlComModuleRevokeClassObjects(ptr)
22 stdcall AtlComModuleUnregisterServer(ptr long ptr) atl100.AtlComModuleUnregisterServer 22 stdcall AtlComModuleUnregisterServer(ptr long ptr)
23 stdcall AtlUpdateRegistryFromResourceD(long wstr long ptr ptr) atl100.AtlUpdateRegistryFromResourceD 23 stdcall AtlUpdateRegistryFromResourceD(long wstr long ptr ptr)
24 stdcall AtlWaitWithMessageLoop(long) atl100.AtlWaitWithMessageLoop 24 stdcall AtlWaitWithMessageLoop(long)
25 stub AtlSetErrorInfo 25 stub AtlSetErrorInfo
26 stdcall AtlCreateTargetDC(long ptr) atl100.AtlCreateTargetDC 26 stdcall AtlCreateTargetDC(long ptr)
27 stdcall AtlHiMetricToPixel(ptr ptr) atl100.AtlHiMetricToPixel 27 stdcall AtlHiMetricToPixel(ptr ptr)
28 stdcall AtlPixelToHiMetric(ptr ptr) atl100.AtlPixelToHiMetric 28 stdcall AtlPixelToHiMetric(ptr ptr)
29 stub AtlDevModeW2A 29 stub AtlDevModeW2A
30 stdcall AtlComPtrAssign(ptr ptr) atl100.AtlComPtrAssign 30 stdcall AtlComPtrAssign(ptr ptr)
31 stdcall AtlComQIPtrAssign(ptr ptr ptr) atl100.AtlComQIPtrAssign 31 stdcall AtlComQIPtrAssign(ptr ptr ptr)
32 stdcall AtlInternalQueryInterface(ptr ptr ptr ptr) atl100.AtlInternalQueryInterface 32 stdcall AtlInternalQueryInterface(ptr ptr ptr ptr)
34 stdcall AtlGetVersion(ptr) 34 stdcall AtlGetVersion(ptr)
35 stdcall AtlAxDialogBoxW(long wstr long ptr long) atl100.AtlAxDialogBoxW 35 stdcall AtlAxDialogBoxW(long wstr long ptr long)
36 stdcall AtlAxDialogBoxA(long str long ptr long) atl100.AtlAxDialogBoxA 36 stdcall AtlAxDialogBoxA(long str long ptr long)
37 stdcall AtlAxCreateDialogW(long wstr long ptr long) atl100.AtlAxCreateDialogW 37 stdcall AtlAxCreateDialogW(long wstr long ptr long)
38 stdcall AtlAxCreateDialogA(long str long ptr long) atl100.AtlAxCreateDialogA 38 stdcall AtlAxCreateDialogA(long str long ptr long)
39 stdcall AtlAxCreateControl(ptr ptr ptr ptr) atl100.AtlAxCreateControl 39 stdcall AtlAxCreateControl(ptr ptr ptr ptr)
40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr) atl100.AtlAxCreateControlEx 40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr)
41 stdcall AtlAxAttachControl(ptr ptr ptr) atl100.AtlAxAttachControl 41 stdcall AtlAxAttachControl(ptr ptr ptr)
42 stdcall AtlAxWinInit() 42 stdcall AtlAxWinInit()
43 stdcall AtlWinModuleAddCreateWndData(ptr ptr ptr) atl100.AtlWinModuleAddCreateWndData 43 stdcall AtlWinModuleAddCreateWndData(ptr ptr ptr)
44 stdcall AtlWinModuleExtractCreateWndData(ptr) atl100.AtlWinModuleExtractCreateWndData 44 stdcall AtlWinModuleExtractCreateWndData(ptr)
45 stub AtlWinModuleRegisterWndClassInfoW 45 stub AtlWinModuleRegisterWndClassInfoW
46 stub AtlWinModuleRegisterWndClassInfoA 46 stub AtlWinModuleRegisterWndClassInfoA
47 stdcall AtlAxGetControl(long ptr) atl100.AtlAxGetControl 47 stdcall AtlAxGetControl(long ptr)
48 stdcall AtlAxGetHost(long ptr) atl100.AtlAxGetHost 48 stdcall AtlAxGetHost(long ptr)
49 stdcall AtlRegisterClassCategoriesHelper(ptr ptr long) atl100.AtlRegisterClassCategoriesHelper 49 stdcall AtlRegisterClassCategoriesHelper(ptr ptr long)
50 stdcall AtlIPersistStreamInit_Load(ptr ptr ptr ptr) atl100.AtlIPersistStreamInit_Load 50 stdcall AtlIPersistStreamInit_Load(ptr ptr ptr ptr)
51 stdcall AtlIPersistStreamInit_Save(ptr long ptr ptr ptr) atl100.AtlIPersistStreamInit_Save 51 stdcall AtlIPersistStreamInit_Save(ptr long ptr ptr ptr)
52 stdcall AtlIPersistPropertyBag_Load(ptr ptr ptr ptr ptr) atl100.AtlIPersistPropertyBag_Load 52 stdcall AtlIPersistPropertyBag_Load(ptr ptr ptr ptr ptr)
53 stub AtlIPersistPropertyBag_Save 53 stub AtlIPersistPropertyBag_Save
54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr) atl100.AtlGetObjectSourceInterface 54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr)
55 stub AtlUnRegisterTypeLib 55 stub AtlUnRegisterTypeLib
56 stdcall AtlLoadTypeLib(long wstr ptr ptr) atl100.AtlLoadTypeLib 56 stdcall AtlLoadTypeLib(long wstr ptr ptr)
58 stdcall AtlModuleAddTermFunc(ptr ptr long) atl100.AtlModuleAddTermFunc 58 stdcall AtlModuleAddTermFunc(ptr ptr long)
59 stub AtlAxCreateControlLic 59 stub AtlAxCreateControlLic
60 stub AtlAxCreateControlLicEx 60 stub AtlAxCreateControlLicEx
61 stdcall AtlCreateRegistrar(ptr) atl100.AtlCreateRegistrar 61 stdcall AtlCreateRegistrar(ptr)
62 stub AtlWinModuleRegisterClassExW 62 stub AtlWinModuleRegisterClassExW
63 stub AtlWinModuleRegisterClassExA 63 stub AtlWinModuleRegisterClassExA
64 stdcall AtlCallTermFunc(ptr) atl100.AtlCallTermFunc 64 stdcall AtlCallTermFunc(ptr)
65 stdcall AtlWinModuleInit(ptr) atl100.AtlWinModuleInit 65 stdcall AtlWinModuleInit(ptr)
66 stub AtlWinModuleTerm 66 stub AtlWinModuleTerm

24
dll/win32/atl80/precomp.h Normal file
View file

@ -0,0 +1,24 @@
#ifndef _ATL80_PCH_
#define _ATL80_PCH_
#include <stdarg.h>
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <objbase.h>
#include <oleauto.h>
#include <wine/atlbase.h>
#include <wine/debug.h>
#include <wine/unicode.h>
WINE_DEFAULT_DEBUG_CHANNEL(atl);
#endif /* _ATL80_PCH_ */

View file

@ -221,7 +221,7 @@ GetDeviceCapabilities(
caps->vDriverVersion = 0x0100; caps->vDriverVersion = 0x0100;
memset(caps->szPname, 0, sizeof(caps->szPname)); memset(caps->szPname, 0, sizeof(caps->szPname));
memcpy(caps->szPname, L"PC speaker\0", strlen("PC speaker\0") * 2); wcscpy(caps->szPname, L"PC speaker");
caps->wTechnology = MOD_SQSYNTH; caps->wTechnology = MOD_SQSYNTH;

View file

@ -23,8 +23,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
static unsigned arm_get_addr(HANDLE hThread, const CONTEXT* ctx, static BOOL arm_get_addr(HANDLE hThread, const CONTEXT* ctx,
enum cpu_addr ca, ADDRESS64* addr) enum cpu_addr ca, ADDRESS64* addr)
{ {
addr->Mode = AddrModeFlat; addr->Mode = AddrModeFlat;
addr->Segment = 0; /* don't need segment */ addr->Segment = 0; /* don't need segment */

View file

@ -2,7 +2,7 @@
* File cpu_arm64.c * File cpu_arm64.c
* *
* Copyright (C) 2009 Eric Pouech * Copyright (C) 2009 Eric Pouech
* Copyright (C) 2010-2013 Andrأ© Hentschel * Copyright (C) 2010-2013 André Hentschel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -23,8 +23,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
static unsigned arm64_get_addr(HANDLE hThread, const CONTEXT* ctx, static BOOL arm64_get_addr(HANDLE hThread, const CONTEXT* ctx,
enum cpu_addr ca, ADDRESS64* addr) enum cpu_addr ca, ADDRESS64* addr)
{ {
addr->Mode = AddrModeFlat; addr->Mode = AddrModeFlat;
addr->Segment = 0; /* don't need segment */ addr->Segment = 0; /* don't need segment */

View file

@ -45,8 +45,8 @@ static ADDRESS_MODE get_selector_type(HANDLE hThread, const CONTEXT* ctx, WORD s
return -1; return -1;
} }
static unsigned i386_build_addr(HANDLE hThread, const CONTEXT* ctx, ADDRESS64* addr, static BOOL i386_build_addr(HANDLE hThread, const CONTEXT* ctx, ADDRESS64* addr,
unsigned seg, unsigned long offset) unsigned seg, unsigned long offset)
{ {
addr->Mode = AddrModeFlat; addr->Mode = AddrModeFlat;
addr->Segment = seg; addr->Segment = seg;
@ -71,8 +71,8 @@ static unsigned i386_build_addr(HANDLE hThread, const CONTEXT* ctx, ADDRESS64* a
#endif #endif
#ifndef DBGHELP_STATIC_LIB #ifndef DBGHELP_STATIC_LIB
static unsigned i386_get_addr(HANDLE hThread, const CONTEXT* ctx, static BOOL i386_get_addr(HANDLE hThread, const CONTEXT* ctx,
enum cpu_addr ca, ADDRESS64* addr) enum cpu_addr ca, ADDRESS64* addr)
{ {
#ifdef __i386__ #ifdef __i386__
switch (ca) switch (ca)

View file

@ -22,8 +22,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
static unsigned ppc_get_addr(HANDLE hThread, const CONTEXT* ctx, static BOOL ppc_get_addr(HANDLE hThread, const CONTEXT* ctx,
enum cpu_addr ca, ADDRESS64* addr) enum cpu_addr ca, ADDRESS64* addr)
{ {
switch (ca) switch (ca)
{ {

View file

@ -83,8 +83,8 @@ typedef struct _UNWIND_INFO
#define GetExceptionDataPtr(info) \ #define GetExceptionDataPtr(info) \
((PVOID)((PULONG)GetLanguageSpecificData(info) + 1) ((PVOID)((PULONG)GetLanguageSpecificData(info) + 1)
static unsigned x86_64_get_addr(HANDLE hThread, const CONTEXT* ctx, static BOOL x86_64_get_addr(HANDLE hThread, const CONTEXT* ctx,
enum cpu_addr ca, ADDRESS64* addr) enum cpu_addr ca, ADDRESS64* addr)
{ {
addr->Mode = AddrModeFlat; addr->Mode = AddrModeFlat;
switch (ca) switch (ca)

View file

@ -60,25 +60,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
*/ */
unsigned dbghelp_options = SYMOPT_UNDNAME; unsigned dbghelp_options = SYMOPT_UNDNAME;
HANDLE hMsvcrt = NULL;
/***********************************************************************
* DllMain (DEBUGHLP.@)
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH: break;
case DLL_PROCESS_DETACH:
if (hMsvcrt) FreeLibrary(hMsvcrt);
break;
case DLL_THREAD_ATTACH: break;
case DLL_THREAD_DETACH: break;
default: break;
}
return TRUE;
}
static struct process* process_first /* = NULL */; static struct process* process_first /* = NULL */;

View file

@ -569,7 +569,7 @@ struct cpu
DWORD frame_regno; DWORD frame_regno;
/* address manipulation */ /* address manipulation */
unsigned (*get_addr)(HANDLE hThread, const CONTEXT* ctx, BOOL (*get_addr)(HANDLE hThread, const CONTEXT* ctx,
enum cpu_addr, ADDRESS64* addr); enum cpu_addr, ADDRESS64* addr);
/* stack manipulation */ /* stack manipulation */
@ -594,7 +594,6 @@ extern struct cpu* dbghelp_current_cpu DECLSPEC_HIDDEN;
/* dbghelp.c */ /* dbghelp.c */
extern struct process* process_find_by_handle(HANDLE hProcess) DECLSPEC_HIDDEN; extern struct process* process_find_by_handle(HANDLE hProcess) DECLSPEC_HIDDEN;
extern HANDLE hMsvcrt DECLSPEC_HIDDEN;
extern BOOL validate_addr64(DWORD64 addr) DECLSPEC_HIDDEN; extern BOOL validate_addr64(DWORD64 addr) DECLSPEC_HIDDEN;
extern BOOL pcs_callback(const struct process* pcs, ULONG action, void* data) DECLSPEC_HIDDEN; extern BOOL pcs_callback(const struct process* pcs, ULONG action, void* data) DECLSPEC_HIDDEN;
extern void* fetch_buffer(struct process* pcs, unsigned size) DECLSPEC_HIDDEN; extern void* fetch_buffer(struct process* pcs, unsigned size) DECLSPEC_HIDDEN;

View file

@ -513,7 +513,7 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx,
break; break;
case DW_FORM_ref8: case DW_FORM_ref8:
FIXME("Unhandled 64 bit support\n"); FIXME("Unhandled 64-bit support\n");
break; break;
case DW_FORM_sdata: case DW_FORM_sdata:
@ -1408,6 +1408,9 @@ static struct symt* dwarf2_parse_udt_type(dwarf2_parse_context_t* ctx,
switch (child->abbrev->tag) switch (child->abbrev->tag)
{ {
case DW_TAG_array_type:
dwarf2_parse_array_type(ctx, di);
break;
case DW_TAG_member: case DW_TAG_member:
/* FIXME: should I follow the sibling stuff ?? */ /* FIXME: should I follow the sibling stuff ?? */
dwarf2_parse_udt_member(ctx, child, (struct symt_udt*)di->symt); dwarf2_parse_udt_member(ctx, child, (struct symt_udt*)di->symt);
@ -1678,7 +1681,10 @@ static void dwarf2_parse_subprogram_label(dwarf2_subprogram_t* subpgm,
static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm, static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm,
struct symt_block* parent_block, struct symt_block* parent_block,
dwarf2_debug_info_t* di); dwarf2_debug_info_t* di);
static struct symt* dwarf2_parse_subroutine_type(dwarf2_parse_context_t* ctx,
dwarf2_debug_info_t* di);
static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm,
struct symt_block* parent_block, struct symt_block* parent_block,
@ -1769,6 +1775,12 @@ static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm,
case DW_TAG_variable: case DW_TAG_variable:
dwarf2_parse_variable(subpgm, block, child); dwarf2_parse_variable(subpgm, block, child);
break; break;
case DW_TAG_pointer_type:
dwarf2_parse_pointer_type(subpgm->ctx, di);
break;
case DW_TAG_subroutine_type:
dwarf2_parse_subroutine_type(subpgm->ctx, di);
break;
case DW_TAG_lexical_block: case DW_TAG_lexical_block:
dwarf2_parse_subprogram_block(subpgm, block, child); dwarf2_parse_subprogram_block(subpgm, block, child);
break; break;
@ -1900,6 +1912,9 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_parse_context_t* ctx,
case DW_TAG_inlined_subroutine: case DW_TAG_inlined_subroutine:
dwarf2_parse_inlined_subroutine(&subpgm, NULL, child); dwarf2_parse_inlined_subroutine(&subpgm, NULL, child);
break; break;
case DW_TAG_pointer_type:
dwarf2_parse_pointer_type(subpgm.ctx, di);
break;
case DW_TAG_subprogram: case DW_TAG_subprogram:
/* FIXME: likely a declaration (to be checked) /* FIXME: likely a declaration (to be checked)
* skip it for now * skip it for now

View file

@ -43,6 +43,32 @@
#define NT_GNU_BUILD_ID 3 #define NT_GNU_BUILD_ID 3
#endif #endif
#ifndef HAVE_STRUCT_R_DEBUG
struct r_debug
{
int r_version;
struct link_map *r_map;
ElfW(Addr) r_brk;
enum
{
RT_CONSISTENT,
RT_ADD,
RT_DELETE
} r_state;
ElfW(Addr) r_ldbase;
};
#endif /* HAVE_STRUCT_R_DEBUG */
#ifndef HAVE_STRUCT_LINK_MAP
struct link_map
{
ElfW(Addr) l_addr;
char *l_name;
ElfW(Dyn) *l_ld;
struct link_map *l_next, *l_prev;
};
#endif /* HAVE_STRUCT_LINK_MAP */
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
struct elf_info struct elf_info
@ -1427,7 +1453,7 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
{ {
BOOL ret = FALSE; BOOL ret = FALSE;
struct module* module; struct module* module;
static WCHAR S_libstdcPPW[] = {'l','i','b','s','t','d','c','+','+','\0'}; static const WCHAR S_libstdcPPW[] = {'l','i','b','s','t','d','c','+','+','\0'};
if (filename == NULL || *filename == '\0') return FALSE; if (filename == NULL || *filename == '\0') return FALSE;
if ((module = module_is_already_loaded(pcs, filename))) if ((module = module_is_already_loaded(pcs, filename)))
@ -1682,8 +1708,8 @@ struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned
/****************************************************************** /******************************************************************
* elf_synchronize_module_list * elf_synchronize_module_list
* *
* this functions rescans the debuggee module's list and synchronizes it with * this function rescans the debuggee module's list and synchronizes it with
* the one from 'pcs', ie: * the one from 'pcs', i.e.:
* - if a module is in debuggee and not in pcs, it's loaded into pcs * - if a module is in debuggee and not in pcs, it's loaded into pcs
* - if a module is in pcs and not in debuggee, it's unloaded from pcs * - if a module is in pcs and not in debuggee, it's unloaded from pcs
*/ */

View file

@ -420,17 +420,32 @@ static BOOL macho_map_file(const WCHAR* filenameW, struct macho_file_map* fmap)
RtlInitializeBitMap(&fmap->sect_is_code, fmap->sect_is_code_buff, MAX_SECT + 1); RtlInitializeBitMap(&fmap->sect_is_code, fmap->sect_is_code_buff, MAX_SECT + 1);
len = WideCharToMultiByte(CP_UNIXCP, 0, filenameW, -1, NULL, 0, NULL, NULL); len = WideCharToMultiByte(CP_UNIXCP, 0, filenameW, -1, NULL, 0, NULL, NULL);
if (!(filename = HeapAlloc(GetProcessHeap(), 0, len))) return FALSE; if (!(filename = HeapAlloc(GetProcessHeap(), 0, len)))
{
WARN("failed to allocate filename buffer\n");
return FALSE;
}
WideCharToMultiByte(CP_UNIXCP, 0, filenameW, -1, filename, len, NULL, NULL); WideCharToMultiByte(CP_UNIXCP, 0, filenameW, -1, filename, len, NULL, NULL);
/* check that the file exists */ /* check that the file exists */
if (stat(filename, &statbuf) == -1 || S_ISDIR(statbuf.st_mode)) goto done; if (stat(filename, &statbuf) == -1 || S_ISDIR(statbuf.st_mode))
{
TRACE("stat() failed or %s is directory: %s\n", debugstr_a(filename), strerror(errno));
goto done;
}
/* Now open the file, so that we can mmap() it. */ /* Now open the file, so that we can mmap() it. */
if ((fmap->fd = open(filename, O_RDONLY)) == -1) goto done; if ((fmap->fd = open(filename, O_RDONLY)) == -1)
{
TRACE("failed to open file %s: %d\n", debugstr_a(filename), errno);
goto done;
}
if (read(fmap->fd, &fat_header, sizeof(fat_header)) != sizeof(fat_header)) if (read(fmap->fd, &fat_header, sizeof(fat_header)) != sizeof(fat_header))
{
TRACE("failed to read fat header: %d\n", errno);
goto done; goto done;
}
TRACE("... got possible fat header\n"); TRACE("... got possible fat header\n");
/* Fat header is always in big-endian order. */ /* Fat header is always in big-endian order. */
@ -936,23 +951,52 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename,
*/ */
if (macho_info->flags & MACHO_INFO_DEBUG_HEADER) if (macho_info->flags & MACHO_INFO_DEBUG_HEADER)
{ {
static void* dyld_all_image_infos_addr; PROCESS_BASIC_INFORMATION pbi;
NTSTATUS status;
/* This symbol should be in the same place in all processes. */ ret = FALSE;
if (!dyld_all_image_infos_addr)
/* Get address of PEB */
status = NtQueryInformationProcess(pcs->handle, ProcessBasicInformation,
&pbi, sizeof(pbi), NULL);
if (status == STATUS_SUCCESS)
{ {
struct nlist nl[2]; ULONG dyld_image_info;
memset(nl, 0, sizeof(nl));
nl[0].n_un.n_name = (char*)"_dyld_all_image_infos"; /* Read dyld image info address from PEB */
if (!nlist("/usr/lib/dyld", nl)) if (ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved,
dyld_all_image_infos_addr = (void*)nl[0].n_value; &dyld_image_info, sizeof(dyld_image_info), NULL))
{
TRACE("got dyld_image_info 0x%08x from PEB %p MacDyldImageInfo %p\n",
dyld_image_info, pbi.PebBaseAddress, &pbi.PebBaseAddress->Reserved);
macho_info->dbg_hdr_addr = dyld_image_info;
ret = TRUE;
}
} }
if (dyld_all_image_infos_addr) if (!ret)
macho_info->dbg_hdr_addr = (unsigned long)dyld_all_image_infos_addr; {
else static void* dyld_all_image_infos_addr;
ret = FALSE;
TRACE("dbg_hdr_addr = 0x%08lx\n", macho_info->dbg_hdr_addr); /* Our next best guess is that dyld was loaded at its base address
and we can find the dyld image infos address by looking up its symbol. */
if (!dyld_all_image_infos_addr)
{
struct nlist nl[2];
memset(nl, 0, sizeof(nl));
nl[0].n_un.n_name = (char*)"_dyld_all_image_infos";
if (!nlist("/usr/lib/dyld", nl))
dyld_all_image_infos_addr = (void*)nl[0].n_value;
}
if (dyld_all_image_infos_addr)
{
TRACE("got dyld_image_info %p from /usr/lib/dyld symbol table\n",
dyld_all_image_infos_addr);
macho_info->dbg_hdr_addr = (unsigned long)dyld_all_image_infos_addr;
ret = TRUE;
}
}
} }
if (macho_info->flags & MACHO_INFO_MODULE) if (macho_info->flags & MACHO_INFO_MODULE)
@ -1011,7 +1055,7 @@ leave:
* macho_load_file_from_path * macho_load_file_from_path
* Tries to load a Mach-O file from a set of paths (separated by ':') * Tries to load a Mach-O file from a set of paths (separated by ':')
*/ */
static BOOL macho_load_file_from_path(HANDLE hProcess, static BOOL macho_load_file_from_path(struct process* pcs,
const WCHAR* filename, const WCHAR* filename,
unsigned long load_addr, unsigned long load_addr,
const char* path, const char* path,
@ -1022,7 +1066,7 @@ static BOOL macho_load_file_from_path(HANDLE hProcess,
WCHAR* pathW = NULL; WCHAR* pathW = NULL;
unsigned len; unsigned len;
TRACE("(%p, %s, 0x%08lx, %s, %p)\n", hProcess, debugstr_w(filename), load_addr, TRACE("(%p/%p, %s, 0x%08lx, %s, %p)\n", pcs, pcs->handle, debugstr_w(filename), load_addr,
debugstr_a(path), macho_info); debugstr_a(path), macho_info);
if (!path) return FALSE; if (!path) return FALSE;
@ -1041,7 +1085,7 @@ static BOOL macho_load_file_from_path(HANDLE hProcess,
strcpyW(fn, s); strcpyW(fn, s);
strcatW(fn, S_SlashW); strcatW(fn, S_SlashW);
strcatW(fn, filename); strcatW(fn, filename);
ret = macho_load_file(hProcess, fn, load_addr, macho_info); ret = macho_load_file(pcs, fn, load_addr, macho_info);
HeapFree(GetProcessHeap(), 0, fn); HeapFree(GetProcessHeap(), 0, fn);
if (ret) break; if (ret) break;
s = (t) ? (t+1) : NULL; s = (t) ? (t+1) : NULL;
@ -1057,7 +1101,7 @@ static BOOL macho_load_file_from_path(HANDLE hProcess,
* *
* Tries to load a Mach-O file from the dll path * Tries to load a Mach-O file from the dll path
*/ */
static BOOL macho_load_file_from_dll_path(HANDLE hProcess, static BOOL macho_load_file_from_dll_path(struct process* pcs,
const WCHAR* filename, const WCHAR* filename,
unsigned long load_addr, unsigned long load_addr,
struct macho_info* macho_info) struct macho_info* macho_info)
@ -1066,7 +1110,7 @@ static BOOL macho_load_file_from_dll_path(HANDLE hProcess,
unsigned int index = 0; unsigned int index = 0;
const char *path; const char *path;
TRACE("(%p, %s, 0x%08lx, %p)\n", hProcess, debugstr_w(filename), load_addr, TRACE("(%p/%p, %s, 0x%08lx, %p)\n", pcs, pcs->handle, debugstr_w(filename), load_addr,
macho_info); macho_info);
while (!ret && (path = wine_dll_enum_load_path( index++ ))) while (!ret && (path = wine_dll_enum_load_path( index++ )))
@ -1083,7 +1127,7 @@ static BOOL macho_load_file_from_dll_path(HANDLE hProcess,
MultiByteToWideChar(CP_UNIXCP, 0, path, -1, name, len); MultiByteToWideChar(CP_UNIXCP, 0, path, -1, name, len);
strcatW( name, S_SlashW ); strcatW( name, S_SlashW );
strcatW( name, filename ); strcatW( name, filename );
ret = macho_load_file(hProcess, name, load_addr, macho_info); ret = macho_load_file(pcs, name, load_addr, macho_info);
HeapFree( GetProcessHeap(), 0, name ); HeapFree( GetProcessHeap(), 0, name );
} }
TRACE(" => %d\n", ret); TRACE(" => %d\n", ret);
@ -1101,7 +1145,7 @@ static BOOL macho_search_and_load_file(struct process* pcs, const WCHAR* filenam
{ {
BOOL ret = FALSE; BOOL ret = FALSE;
struct module* module; struct module* module;
static WCHAR S_libstdcPPW[] = {'l','i','b','s','t','d','c','+','+','\0'}; static const WCHAR S_libstdcPPW[] = {'l','i','b','s','t','d','c','+','+','\0'};
const WCHAR* p; const WCHAR* p;
TRACE("(%p/%p, %s, 0x%08lx, %p)\n", pcs, pcs->handle, debugstr_w(filename), load_addr, TRACE("(%p/%p, %s, 0x%08lx, %p)\n", pcs, pcs->handle, debugstr_w(filename), load_addr,

View file

@ -23,6 +23,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
#define DLLPREFIX ""
const WCHAR S_ElfW[] = {'<','e','l','f','>','\0'}; const WCHAR S_ElfW[] = {'<','e','l','f','>','\0'};
const WCHAR S_WineLoaderW[] = {'<','w','i','n','e','-','l','o','a','d','e','r','>','\0'}; const WCHAR S_WineLoaderW[] = {'<','w','i','n','e','-','l','o','a','d','e','r','>','\0'};
static const WCHAR S_DotSoW[] = {'.','s','o','\0'}; static const WCHAR S_DotSoW[] = {'.','s','o','\0'};
@ -47,7 +49,7 @@ static int match_ext(const WCHAR* ptr, size_t len)
for (e = ext; *e; e++) for (e = ext; *e; e++)
{ {
l = strlenW(*e); l = strlenW(*e);
if (l >= len) return FALSE; if (l >= len) return 0;
if (strncmpiW(&ptr[len - l], *e, l)) continue; if (strncmpiW(&ptr[len - l], *e, l)) continue;
return l; return l;
} }
@ -96,7 +98,7 @@ void module_set_module(struct module* module, const WCHAR* name)
const WCHAR *get_wine_loader_name(void) const WCHAR *get_wine_loader_name(void)
{ {
static const int is_win64 = sizeof(void *) > sizeof(int); /* FIXME: should depend on target process */ static const BOOL is_win64 = sizeof(void *) > sizeof(int); /* FIXME: should depend on target process */
static const WCHAR wineW[] = {'w','i','n','e',0}; static const WCHAR wineW[] = {'w','i','n','e',0};
static const WCHAR suffixW[] = {'6','4',0}; static const WCHAR suffixW[] = {'6','4',0};
static const WCHAR *loader; static const WCHAR *loader;
@ -420,6 +422,16 @@ static BOOL module_is_container_loaded(const struct process* pcs,
size_t len; size_t len;
struct module* module; struct module* module;
PCWSTR filename, modname; PCWSTR filename, modname;
static WCHAR* dll_prefix;
static int dll_prefix_len;
if (!dll_prefix)
{
dll_prefix_len = MultiByteToWideChar( CP_UNIXCP, 0, DLLPREFIX, -1, NULL, 0 );
dll_prefix = HeapAlloc( GetProcessHeap(), 0, dll_prefix_len * sizeof(WCHAR) );
MultiByteToWideChar( CP_UNIXCP, 0, DLLPREFIX, -1, dll_prefix, dll_prefix_len );
dll_prefix_len--;
}
if (!base) return FALSE; if (!base) return FALSE;
filename = get_filename(ImageName, NULL); filename = get_filename(ImageName, NULL);
@ -432,6 +444,7 @@ static BOOL module_is_container_loaded(const struct process* pcs,
base < module->module.BaseOfImage + module->module.ImageSize) base < module->module.BaseOfImage + module->module.ImageSize)
{ {
modname = get_filename(module->module.LoadedImageName, NULL); modname = get_filename(module->module.LoadedImageName, NULL);
if (dll_prefix_len && !strncmpW( modname, dll_prefix, dll_prefix_len )) modname += dll_prefix_len;
if (!strncmpiW(modname, filename, len) && if (!strncmpiW(modname, filename, len) &&
!memcmp(modname + len, S_DotSoW, 3 * sizeof(WCHAR))) !memcmp(modname + len, S_DotSoW, 3 * sizeof(WCHAR)))
{ {

View file

@ -631,9 +631,9 @@ static struct symt* codeview_add_type_array(struct codeview_type_parse* ctp,
return &symt_new_array(ctp->module, 0, -arr_len, elem, index)->symt; return &symt_new_array(ctp->module, 0, -arr_len, elem, index)->symt;
} }
static int codeview_add_type_enum_field_list(struct module* module, static BOOL codeview_add_type_enum_field_list(struct module* module,
struct symt_enum* symt, struct symt_enum* symt,
const union codeview_reftype* ref_type) const union codeview_reftype* ref_type)
{ {
const unsigned char* ptr = ref_type->fieldlist.list; const unsigned char* ptr = ref_type->fieldlist.list;
const unsigned char* last = (const BYTE*)ref_type + ref_type->generic.len + 2; const unsigned char* last = (const BYTE*)ref_type + ref_type->generic.len + 2;
@ -1307,12 +1307,12 @@ static struct symt* codeview_parse_one_type(struct codeview_type_parse* ctp,
default: default:
FIXME("Unsupported type-id leaf %x\n", type->generic.id); FIXME("Unsupported type-id leaf %x\n", type->generic.id);
dump(type, 2 + type->generic.len); dump(type, 2 + type->generic.len);
return FALSE; return NULL;
} }
return codeview_add_type(curr_type, symt) ? symt : NULL; return codeview_add_type(curr_type, symt) ? symt : NULL;
} }
static int codeview_parse_type_table(struct codeview_type_parse* ctp) static BOOL codeview_parse_type_table(struct codeview_type_parse* ctp)
{ {
unsigned int curr_type = FIRST_DEFINABLE_TYPE; unsigned int curr_type = FIRST_DEFINABLE_TYPE;
const union codeview_type* type; const union codeview_type* type;
@ -1537,8 +1537,8 @@ static inline void codeview_add_variable(const struct msc_debug_info* msc_dbg,
} }
} }
static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root, static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root,
int offset, int size, BOOL do_globals) int offset, int size, BOOL do_globals)
{ {
struct symt_function* curr_func = NULL; struct symt_function* curr_func = NULL;
int i, length; int i, length;
@ -1984,8 +1984,8 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
return TRUE; return TRUE;
} }
static int codeview_snarf_public(const struct msc_debug_info* msc_dbg, const BYTE* root, static BOOL codeview_snarf_public(const struct msc_debug_info* msc_dbg, const BYTE* root,
int offset, int size) int offset, int size)
{ {
int i, length; int i, length;
@ -2619,7 +2619,7 @@ static void pdb_process_symbol_imports(const struct process* pcs,
while (imp < (const PDB_SYMBOL_IMPORT*)last) while (imp < (const PDB_SYMBOL_IMPORT*)last)
{ {
ptr = (const char*)imp + sizeof(*imp) + strlen(imp->filename); ptr = (const char*)imp + sizeof(*imp) + strlen(imp->filename);
if (i >= CV_MAX_MODULES) FIXME("Out of bounds !!!\n"); if (i >= CV_MAX_MODULES) FIXME("Out of bounds!!!\n");
if (!strcasecmp(pdb_lookup->filename, imp->filename)) if (!strcasecmp(pdb_lookup->filename, imp->filename))
{ {
if (module_index != -1) FIXME("Twice the entry\n"); if (module_index != -1) FIXME("Twice the entry\n");
@ -2652,7 +2652,7 @@ static void pdb_process_symbol_imports(const struct process* pcs,
pdb_module_info->used_subfiles = 1; pdb_module_info->used_subfiles = 1;
} }
cv_current_module = &cv_zmodules[module_index]; cv_current_module = &cv_zmodules[module_index];
if (cv_current_module->allowed) FIXME("Already allowed ??\n"); if (cv_current_module->allowed) FIXME("Already allowed??\n");
cv_current_module->allowed = TRUE; cv_current_module->allowed = TRUE;
} }
@ -3235,7 +3235,7 @@ static BOOL codeview_process_info(const struct process* pcs,
ctp.table = (const BYTE*)(ctp.offset + types->cTypes); ctp.table = (const BYTE*)(ctp.offset + types->cTypes);
cv_current_module = &cv_zmodules[0]; cv_current_module = &cv_zmodules[0];
if (cv_current_module->allowed) FIXME("Already allowed ??\n"); if (cv_current_module->allowed) FIXME("Already allowed??\n");
cv_current_module->allowed = TRUE; cv_current_module->allowed = TRUE;
codeview_parse_type_table(&ctp); codeview_parse_type_table(&ctp);

View file

@ -282,7 +282,7 @@ void* sparse_array_add(struct sparse_array* sa, unsigned long key,
pk2i = sparse_array_lookup(sa, key, &idx); pk2i = sparse_array_lookup(sa, key, &idx);
if (pk2i && pk2i->key == key) if (pk2i && pk2i->key == key)
{ {
FIXME("re adding an existing key\n"); FIXME("re-adding an existing key\n");
return NULL; return NULL;
} }
to = vector_add(&sa->key2index, pool); to = vector_add(&sa->key2index, pool);
@ -353,13 +353,13 @@ void hash_table_destroy(struct hash_table* ht)
variance = (double)sq / ht->num_buckets - mean * mean; variance = (double)sq / ht->num_buckets - mean * mean;
FIXME("STATS: elts[num:%-4u size:%u mean:%f] buckets[min:%-4u variance:%+f max:%-4u]\n", FIXME("STATS: elts[num:%-4u size:%u mean:%f] buckets[min:%-4u variance:%+f max:%-4u]\n",
ht->num_elts, ht->num_buckets, mean, min, variance, max); ht->num_elts, ht->num_buckets, mean, min, variance, max);
#if 1
for (i = 0; i < ht->num_buckets; i++) for (i = 0; i < ht->num_buckets; i++)
{ {
for (len = 0, elt = ht->buckets[i]; elt; elt = elt->next) len++; for (len = 0, elt = ht->buckets[i]; elt; elt = elt->next) len++;
if (len == max) if (len == max)
{ {
FIXME("Longuest bucket:\n"); FIXME("Longest bucket:\n");
for (elt = ht->buckets[i]; elt; elt = elt->next) for (elt = ht->buckets[i]; elt; elt = elt->next)
FIXME("\t%s\n", elt->name); FIXME("\t%s\n", elt->name);
break; break;
@ -367,7 +367,6 @@ void hash_table_destroy(struct hash_table* ht)
} }
#endif #endif
#endif
} }
void hash_table_add(struct hash_table* ht, struct hash_table_elt* elt) void hash_table_add(struct hash_table* ht, struct hash_table_elt* elt)

View file

@ -24,7 +24,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
WINE_DECLARE_DEBUG_CHANNEL(dbghelp_symt); WINE_DECLARE_DEBUG_CHANNEL(dbghelp_symt);
static WCHAR starW[] = {'*','\0'}; static const WCHAR starW[] = {'*','\0'};
static inline int cmp_addr(ULONG64 a1, ULONG64 a2) static inline int cmp_addr(ULONG64 a1, ULONG64 a2)
{ {
@ -703,8 +703,8 @@ static void symt_fill_sym_info(struct module_pair* pair,
if (sym_info->MaxNameLen) if (sym_info->MaxNameLen)
{ {
if (sym->tag != SymTagPublicSymbol || !(dbghelp_options & SYMOPT_UNDNAME) || if (sym->tag != SymTagPublicSymbol || !(dbghelp_options & SYMOPT_UNDNAME) ||
(sym_info->NameLen = UnDecorateSymbolName(name, sym_info->Name, ((sym_info->NameLen = UnDecorateSymbolName(name, sym_info->Name,
sym_info->MaxNameLen, UNDNAME_NAME_ONLY) == 0)) sym_info->MaxNameLen, UNDNAME_NAME_ONLY)) == 0))
{ {
sym_info->NameLen = min(strlen(name), sym_info->MaxNameLen - 1); sym_info->NameLen = min(strlen(name), sym_info->MaxNameLen - 1);
memcpy(sym_info->Name, name, sym_info->NameLen); memcpy(sym_info->Name, name, sym_info->NameLen);
@ -1236,7 +1236,8 @@ BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 Address,
if ((sym = symt_find_nearest(pair.effective, Address)) == NULL) return FALSE; if ((sym = symt_find_nearest(pair.effective, Address)) == NULL) return FALSE;
symt_fill_sym_info(&pair, NULL, &sym->symt, Symbol); symt_fill_sym_info(&pair, NULL, &sym->symt, Symbol);
*Displacement = Address - Symbol->Address; if (Displacement)
*Displacement = Address - Symbol->Address;
return TRUE; return TRUE;
} }
@ -1766,6 +1767,7 @@ DWORD WINAPI UnDecorateSymbolName(PCSTR DecoratedName, PSTR UnDecoratedName,
DWORD UndecoratedLength, DWORD Flags) DWORD UndecoratedLength, DWORD Flags)
{ {
/* undocumented from msvcrt */ /* undocumented from msvcrt */
static HANDLE hMsvcrt;
static char* (CDECL *p_undname)(char*, const char*, int, void* (CDECL*)(size_t), void (CDECL*)(void*), unsigned short); static char* (CDECL *p_undname)(char*, const char*, int, void* (CDECL*)(size_t), void (CDECL*)(void*), unsigned short);
static const WCHAR szMsvcrt[] = {'m','s','v','c','r','t','.','d','l','l',0}; static const WCHAR szMsvcrt[] = {'m','s','v','c','r','t','.','d','l','l',0};

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#pragma makedep register
[ [
helpstring("HNetCfg.FwMgr"), helpstring("HNetCfg.FwMgr"),
progid("HNetCfg.FwMgr"), progid("HNetCfg.FwMgr"),

View file

@ -18,4 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#pragma makedep regtypelib
#include "netfw.idl" #include "netfw.idl"

View file

@ -74,6 +74,7 @@ typedef struct {
IHlinkFrame IHlinkFrame_iface; IHlinkFrame IHlinkFrame_iface;
ITargetFrame2 ITargetFrame2_iface; ITargetFrame2 ITargetFrame2_iface;
ITargetFramePriv2 ITargetFramePriv2_iface; ITargetFramePriv2 ITargetFramePriv2_iface;
IWebBrowserPriv2IE9 IWebBrowserPriv2IE9_iface;
IUnknown *outer; IUnknown *outer;
DocHost *doc_host; DocHost *doc_host;

View file

@ -34,9 +34,13 @@ HKCR
{ {
shellex shellex
{ {
MayChangeDefaultMenu {} MayChangeDefaultMenu
} }
} }
'{8856f961-340a-11d0-a96b-00c04fd705a2}'
{
Control
}
} }
'InternetShortcut' 'InternetShortcut'
{ {

View file

@ -16,6 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#pragma makedep regtypelib
#pragma makedep register
#include "exdisp.idl" #include "exdisp.idl"
[ [

View file

@ -1437,6 +1437,45 @@ static const ITargetFramePriv2Vtbl TargetFramePriv2Vtbl = {
TargetFramePriv2_AggregatedNavigation2 TargetFramePriv2_AggregatedNavigation2
}; };
static inline HlinkFrame *impl_from_IWebBrowserPriv2IE9(IWebBrowserPriv2IE9 *iface)
{
return CONTAINING_RECORD(iface, HlinkFrame, IWebBrowserPriv2IE9_iface);
}
static HRESULT WINAPI WebBrowserPriv2IE9_QueryInterface(IWebBrowserPriv2IE9 *iface, REFIID riid, void **ppv)
{
HlinkFrame *This = impl_from_IWebBrowserPriv2IE9(iface);
return IUnknown_QueryInterface(This->outer, riid, ppv);
}
static ULONG WINAPI WebBrowserPriv2IE9_AddRef(IWebBrowserPriv2IE9 *iface)
{
HlinkFrame *This = impl_from_IWebBrowserPriv2IE9(iface);
return IUnknown_AddRef(This->outer);
}
static ULONG WINAPI WebBrowserPriv2IE9_Release(IWebBrowserPriv2IE9 *iface)
{
HlinkFrame *This = impl_from_IWebBrowserPriv2IE9(iface);
return IUnknown_Release(This->outer);
}
static HRESULT WINAPI WebBrowserPriv2IE9_NavigateWithBindCtx2(IWebBrowserPriv2IE9 *iface, IUri *uri, VARIANT *flags,
VARIANT *target_frame, VARIANT *post_data, VARIANT *headers, IBindCtx *bind_ctx, LPOLESTR url_fragment, DWORD unused)
{
HlinkFrame *This = impl_from_IWebBrowserPriv2IE9(iface);
FIXME("(%p)->(%p %s %s %s %s %p %s)\n", This, uri, debugstr_variant(flags), debugstr_variant(target_frame),
debugstr_variant(post_data), debugstr_variant(headers), bind_ctx, debugstr_w(url_fragment));
return E_NOTIMPL;
}
static const IWebBrowserPriv2IE9Vtbl WebBrowserPriv2IE9Vtbl = {
WebBrowserPriv2IE9_QueryInterface,
WebBrowserPriv2IE9_AddRef,
WebBrowserPriv2IE9_Release,
WebBrowserPriv2IE9_NavigateWithBindCtx2
};
BOOL HlinkFrame_QI(HlinkFrame *This, REFIID riid, void **ppv) BOOL HlinkFrame_QI(HlinkFrame *This, REFIID riid, void **ppv)
{ {
if(IsEqualGUID(&IID_IHlinkFrame, riid)) { if(IsEqualGUID(&IID_IHlinkFrame, riid)) {
@ -1451,6 +1490,9 @@ BOOL HlinkFrame_QI(HlinkFrame *This, REFIID riid, void **ppv)
}else if(IsEqualGUID(&IID_ITargetFramePriv2, riid)) { }else if(IsEqualGUID(&IID_ITargetFramePriv2, riid)) {
TRACE("(%p)->(IID_ITargetFramePriv2 %p)\n", This, ppv); TRACE("(%p)->(IID_ITargetFramePriv2 %p)\n", This, ppv);
*ppv = &This->ITargetFramePriv2_iface; *ppv = &This->ITargetFramePriv2_iface;
}else if(IsEqualGUID(&IID_IWebBrowserPriv2IE9, riid)) {
TRACE("(%p)->(IID_IWebBrowserPriv2IE9 %p)\n", This, ppv);
*ppv = &This->IWebBrowserPriv2IE9_iface;
}else { }else {
return FALSE; return FALSE;
} }
@ -1464,6 +1506,7 @@ void HlinkFrame_Init(HlinkFrame *This, IUnknown *outer, DocHost *doc_host)
This->IHlinkFrame_iface.lpVtbl = &HlinkFrameVtbl; This->IHlinkFrame_iface.lpVtbl = &HlinkFrameVtbl;
This->ITargetFrame2_iface.lpVtbl = &TargetFrame2Vtbl; This->ITargetFrame2_iface.lpVtbl = &TargetFrame2Vtbl;
This->ITargetFramePriv2_iface.lpVtbl = &TargetFramePriv2Vtbl; This->ITargetFramePriv2_iface.lpVtbl = &TargetFramePriv2Vtbl;
This->IWebBrowserPriv2IE9_iface.lpVtbl = &WebBrowserPriv2IE9Vtbl;
This->outer = outer; This->outer = outer;
This->doc_host = doc_host; This->doc_host = doc_host;

View file

@ -688,7 +688,7 @@ static HRESULT WINAPI DocObjectService_FireBeforeNavigate2(
V_VT(params+3) = (VT_BYREF|VT_VARIANT); V_VT(params+3) = (VT_BYREF|VT_VARIANT);
V_VARIANTREF(params+3) = &var_frame_name; V_VARIANTREF(params+3) = &var_frame_name;
V_VT(&var_frame_name) = VT_BSTR; V_VT(&var_frame_name) = VT_BSTR;
V_BSTR(&var_frame_name) = NULL; V_BSTR(&var_frame_name) = lpszFrameName ? SysAllocString(lpszFrameName) : NULL;
V_VT(params+4) = (VT_BYREF|VT_VARIANT); V_VT(params+4) = (VT_BYREF|VT_VARIANT);
V_VARIANTREF(params+4) = &var_flags; V_VARIANTREF(params+4) = &var_flags;
@ -709,6 +709,7 @@ static HRESULT WINAPI DocObjectService_FireBeforeNavigate2(
SysFreeString(V_BSTR(&var_url)); SysFreeString(V_BSTR(&var_url));
SysFreeString(V_BSTR(&var_headers)); SysFreeString(V_BSTR(&var_headers));
SysFreeString(V_BSTR(&var_frame_name));
SafeArrayDestroy(post_data); SafeArrayDestroy(post_data);
*pfCancel = !!cancel; *pfCancel = !!cancel;

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#pragma makedep register
[ [
helpstring("Microsoft Active Setup Engine"), helpstring("Microsoft Active Setup Engine"),
threading(apartment), threading(apartment),

View file

@ -480,8 +480,8 @@ SockReenableAsyncSelectEvent (
typedef VOID (*PASYNC_COMPLETION_ROUTINE)(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock); typedef VOID (*PASYNC_COMPLETION_ROUTINE)(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock);
DWORD
FORCEINLINE FORCEINLINE
DWORD
MsafdReturnWithErrno(NTSTATUS Status, MsafdReturnWithErrno(NTSTATUS Status,
LPINT Errno, LPINT Errno,
DWORD Received, DWORD Received,

View file

@ -73,12 +73,14 @@ StartupWindowThread(LPVOID lpParam)
FALSE, FALSE,
DUPLICATE_SAME_ACCESS)) DUPLICATE_SAME_ACCESS))
{ {
ERR("Duplicating handle failed!\n");
HeapFree(GetProcessHeap(), 0, lpParam); HeapFree(GetProcessHeap(), 0, lpParam);
return FALSE; return FALSE;
} }
if(!SetThreadDesktop(hDesk)) if(!SetThreadDesktop(hDesk))
{ {
ERR("Setting thread desktop failed!\n");
HeapFree(GetProcessHeap(), 0, lpParam); HeapFree(GetProcessHeap(), 0, lpParam);
return FALSE; return FALSE;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Before After
Before After

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Before After
Before After

View file

@ -21,8 +21,6 @@ list(APPEND SOURCE
htmlcomment.c htmlcomment.c
htmlcurstyle.c htmlcurstyle.c
htmldoc.c htmldoc.c
htmldoc3.c
htmldoc5.c
htmlelem.c htmlelem.c
htmlelem2.c htmlelem2.c
htmlelem3.c htmlelem3.c

View file

@ -49,6 +49,12 @@ typedef struct {
struct list request_headers; struct list request_headers;
} nsChannel; } nsChannel;
typedef struct {
WCHAR *headers;
HGLOBAL post_data;
ULONG post_data_len;
} request_data_t;
typedef struct BSCallbackVtbl BSCallbackVtbl; typedef struct BSCallbackVtbl BSCallbackVtbl;
struct BSCallback { struct BSCallback {
@ -61,9 +67,7 @@ struct BSCallback {
LONG ref; LONG ref;
LPWSTR headers; request_data_t request_data;
HGLOBAL post_data;
ULONG post_data_len;
ULONG readed; ULONG readed;
DWORD bindf; DWORD bindf;
BOOL bindinfo_ready; BOOL bindinfo_ready;
@ -102,6 +106,8 @@ typedef struct {
#define BINDING_REPLACE 0x0002 #define BINDING_REPLACE 0x0002
#define BINDING_FROMHIST 0x0004 #define BINDING_FROMHIST 0x0004
#define BINDING_REFRESH 0x0008 #define BINDING_REFRESH 0x0008
#define BINDING_SUBMIT 0x0010
#define BINDING_NOFRAG 0x0020
HRESULT set_http_header(struct list*,const WCHAR*,int,const WCHAR*,int) DECLSPEC_HIDDEN; HRESULT set_http_header(struct list*,const WCHAR*,int,const WCHAR*,int) DECLSPEC_HIDDEN;
HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_HIDDEN; HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_HIDDEN;
@ -116,9 +122,10 @@ HRESULT super_navigate(HTMLOuterWindow*,IUri*,DWORD,const WCHAR*,BYTE*,DWORD) DE
HRESULT load_uri(HTMLOuterWindow*,IUri*,DWORD) DECLSPEC_HIDDEN; HRESULT load_uri(HTMLOuterWindow*,IUri*,DWORD) DECLSPEC_HIDDEN;
HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,IHTMLWindow2**) DECLSPEC_HIDDEN; HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,IHTMLWindow2**) DECLSPEC_HIDDEN;
HRESULT navigate_url(HTMLOuterWindow*,const WCHAR*,IUri*,DWORD) DECLSPEC_HIDDEN; HRESULT navigate_url(HTMLOuterWindow*,const WCHAR*,IUri*,DWORD) DECLSPEC_HIDDEN;
HRESULT submit_form(HTMLOuterWindow*,IUri*,nsIInputStream*) DECLSPEC_HIDDEN;
HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC**) DECLSPEC_HIDDEN; HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC**) DECLSPEC_HIDDEN;
HRESULT channelbsc_load_stream(HTMLInnerWindow*,IStream*) DECLSPEC_HIDDEN; HRESULT channelbsc_load_stream(HTMLInnerWindow*,IMoniker*,IStream*) DECLSPEC_HIDDEN;
void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*) DECLSPEC_HIDDEN; void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*) DECLSPEC_HIDDEN;
IUri *nsuri_get_uri(nsWineURI*) DECLSPEC_HIDDEN; IUri *nsuri_get_uri(nsWineURI*) DECLSPEC_HIDDEN;

View file

@ -53,47 +53,81 @@ static HRESULT navigate_anchor_window(HTMLAnchorElement *This, const WCHAR *targ
return hres; return hres;
} }
static HRESULT navigate_anchor(HTMLAnchorElement *This) HTMLOuterWindow *get_target_window(HTMLOuterWindow *window, nsAString *target_str, BOOL *use_new_window)
{ {
nsAString href_str, target_str; HTMLOuterWindow *top_window, *ret_window;
HTMLOuterWindow *window = NULL; const PRUnichar *target;
nsresult nsres; HRESULT hres;
HRESULT hres = E_FAIL;
static const WCHAR _parentW[] = {'p','a','r','e','n','t',0}; static const WCHAR _parentW[] = {'_','p','a','r','e','n','t',0};
static const WCHAR _selfW[] = {'_','s','e','l','f',0}; static const WCHAR _selfW[] = {'_','s','e','l','f',0};
static const WCHAR _topW[] = {'_','t','o','p',0}; static const WCHAR _topW[] = {'_','t','o','p',0};
*use_new_window = FALSE;
nsAString_GetData(target_str, &target);
TRACE("%s\n", debugstr_w(target));
if(!*target || !strcmpiW(target, _selfW)) {
IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
return window;
}
if(!strcmpiW(target, _topW)) {
get_top_window(window, &top_window);
IHTMLWindow2_AddRef(&top_window->base.IHTMLWindow2_iface);
return top_window;
}
if(!strcmpiW(target, _parentW)) {
if(!window->parent) {
WARN("Window has no parent\n");
return NULL;
}
IHTMLWindow2_AddRef(&window->parent->base.IHTMLWindow2_iface);
return window->parent;
}
get_top_window(window, &top_window);
hres = get_frame_by_name(top_window, target, TRUE, &ret_window);
if(FAILED(hres) || !ret_window) {
*use_new_window = TRUE;
return NULL;
}
IHTMLWindow2_AddRef(&ret_window->base.IHTMLWindow2_iface);
return ret_window;
}
static HRESULT navigate_anchor(HTMLAnchorElement *This)
{
nsAString href_str, target_str;
HTMLOuterWindow *window;
BOOL use_new_window;
nsresult nsres;
HRESULT hres = E_FAIL;
nsAString_Init(&target_str, NULL); nsAString_Init(&target_str, NULL);
nsres = nsIDOMHTMLAnchorElement_GetTarget(This->nsanchor, &target_str); nsres = nsIDOMHTMLAnchorElement_GetTarget(This->nsanchor, &target_str);
if(NS_SUCCEEDED(nsres)) { if(NS_FAILED(nsres))
return E_FAIL;
window = get_target_window(This->element.node.doc->basedoc.window, &target_str, &use_new_window);
if(!window && use_new_window) {
const PRUnichar *target; const PRUnichar *target;
nsAString_GetData(&target_str, &target); nsAString_GetData(&target_str, &target);
TRACE("target %s\n", debugstr_w(target)); hres = navigate_anchor_window(This, target);
if(*target && strcmpiW(target, _selfW)) { nsAString_Finish(&target_str);
if(!strcmpiW(target, _topW)) { return hres;
TRACE("target _top\n");
get_top_window(This->element.node.doc->basedoc.window, &window);
}else if(!strcmpiW(target, _parentW)) {
FIXME("Navigating to target _parent is not implemented\n");
nsAString_Finish(&target_str);
return S_OK;
}else {
HTMLOuterWindow *top_window;
get_top_window(This->element.node.doc->basedoc.window, &top_window);
hres = get_frame_by_name(top_window, target, TRUE, &window);
if(FAILED(hres) || !window) {
hres = navigate_anchor_window(This, target);
nsAString_Finish(&target_str);
return hres;
}
}
}
} }
nsAString_Finish(&target_str); nsAString_Finish(&target_str);
if(!window)
return S_OK;
nsAString_Init(&href_str, NULL); nsAString_Init(&href_str, NULL);
nsres = nsIDOMHTMLAnchorElement_GetHref(This->nsanchor, &href_str); nsres = nsIDOMHTMLAnchorElement_GetHref(This->nsanchor, &href_str);
@ -102,15 +136,14 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
nsAString_GetData(&href_str, &href); nsAString_GetData(&href_str, &href);
if(*href) { if(*href) {
if(!window) hres = navigate_url(window, href, window->uri_nofrag, BINDING_NAVIGATED);
window = This->element.node.doc->basedoc.window;
hres = navigate_url(window, href, window->uri, BINDING_NAVIGATED);
}else { }else {
TRACE("empty href\n"); TRACE("empty href\n");
hres = S_OK; hres = S_OK;
} }
} }
nsAString_Finish(&href_str); nsAString_Finish(&href_str);
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
return hres; return hres;
} }

View file

@ -108,7 +108,7 @@ static int loose_hex_to_rgb(const WCHAR *hex)
| comp_value(hex+2*dpc, dpc); | comp_value(hex+2*dpc, dpc);
} }
static HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret) HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret)
{ {
unsigned int i; unsigned int i;
int rgb = -1; int rgb = -1;
@ -139,7 +139,7 @@ static HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret)
return S_OK; return S_OK;
} }
static BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr) BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr)
{ {
switch(V_VT(v)) { switch(V_VT(v)) {
case VT_BSTR: case VT_BSTR:
@ -587,18 +587,71 @@ static HRESULT WINAPI HTMLBodyElement_get_onunload(IHTMLBodyElement *iface, VARI
return E_NOTIMPL; return E_NOTIMPL;
} }
static const WCHAR autoW[] = {'a','u','t','o',0};
static const WCHAR hiddenW[] = {'h','i','d','d','e','n',0};
static const WCHAR scrollW[] = {'s','c','r','o','l','l',0};
static const WCHAR visibleW[] = {'v','i','s','i','b','l','e',0};
static const WCHAR yesW[] = {'y','e','s',0};
static const WCHAR noW[] = {'n','o',0};
static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v) static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v)
{ {
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface); HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v)); static const WCHAR *val;
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
/* Emulate with CSS visibility attribute */
if(!strcmpW(v, yesW)) {
val = scrollW;
}else if(!strcmpW(v, autoW)) {
val = visibleW;
}else if(!strcmpW(v, noW)) {
val = hiddenW;
}else {
WARN("Invalid argument %s\n", debugstr_w(v));
return E_INVALIDARG;
}
return set_elem_style(&This->textcont.element, STYLEID_OVERFLOW, val);
} }
static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p) static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
{ {
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface); HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
FIXME("(%p)->(%p)\n", This, p); const WCHAR *ret = NULL;
return E_NOTIMPL; BSTR overflow;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
/* Emulate with CSS visibility attribute */
hres = get_elem_style(&This->textcont.element, STYLEID_OVERFLOW, &overflow);
if(FAILED(hres))
return hres;
if(!overflow || !*overflow) {
*p = NULL;
hres = S_OK;
}else if(!strcmpW(overflow, visibleW) || !strcmpW(overflow, autoW)) {
ret = autoW;
}else if(!strcmpW(overflow, scrollW)) {
ret = yesW;
}else if(!strcmpW(overflow, hiddenW)) {
ret = noW;
}else {
TRACE("Defaulting %s to NULL\n", debugstr_w(overflow));
*p = NULL;
hres = S_OK;
}
SysFreeString(overflow);
if(ret) {
*p = SysAllocString(ret);
hres = *p ? S_OK : E_OUTOFMEMORY;
}
return hres;
} }
static HRESULT WINAPI HTMLBodyElement_put_onselect(IHTMLBodyElement *iface, VARIANT v) static HRESULT WINAPI HTMLBodyElement_put_onselect(IHTMLBodyElement *iface, VARIANT v)

File diff suppressed because it is too large Load diff

View file

@ -1,837 +0,0 @@
/*
* Copyright 2005 Jacek 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
* 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 "mshtml_private.h"
HRESULT get_doc_elem_by_id(HTMLDocumentNode *doc, const WCHAR *id, HTMLElement **ret)
{
nsIDOMNodeList *nsnode_list;
nsIDOMElement *nselem;
nsIDOMNode *nsnode;
nsAString id_str;
nsresult nsres;
HRESULT hres;
if(!doc->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_InitDepend(&id_str, id);
/* get element by id attribute */
nsres = nsIDOMHTMLDocument_GetElementById(doc->nsdoc, &id_str, &nselem);
if(FAILED(nsres)) {
ERR("GetElementById failed: %08x\n", nsres);
nsAString_Finish(&id_str);
return E_FAIL;
}
/* get first element by name attribute */
nsres = nsIDOMHTMLDocument_GetElementsByName(doc->nsdoc, &id_str, &nsnode_list);
nsAString_Finish(&id_str);
if(FAILED(nsres)) {
ERR("getElementsByName failed: %08x\n", nsres);
if(nselem)
nsIDOMElement_Release(nselem);
return E_FAIL;
}
nsres = nsIDOMNodeList_Item(nsnode_list, 0, &nsnode);
nsIDOMNodeList_Release(nsnode_list);
assert(nsres == NS_OK);
if(nsnode && nselem) {
UINT16 pos;
nsres = nsIDOMNode_CompareDocumentPosition(nsnode, (nsIDOMNode*)nselem, &pos);
if(NS_FAILED(nsres)) {
FIXME("CompareDocumentPosition failed: 0x%08x\n", nsres);
nsIDOMNode_Release(nsnode);
nsIDOMElement_Release(nselem);
return E_FAIL;
}
TRACE("CompareDocumentPosition gave: 0x%x\n", pos);
if(!(pos & (DOCUMENT_POSITION_PRECEDING | DOCUMENT_POSITION_CONTAINS))) {
nsIDOMElement_Release(nselem);
nselem = NULL;
}
}
if(nsnode) {
if(!nselem) {
nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMElement, (void**)&nselem);
assert(nsres == NS_OK);
}
nsIDOMNode_Release(nsnode);
}
if(!nselem) {
*ret = NULL;
return S_OK;
}
hres = get_elem(doc, nselem, ret);
nsIDOMElement_Release(nselem);
return hres;
}
static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface)
{
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument3_iface);
}
static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface,
REFIID riid, void **ppv)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
return htmldoc_query_interface(This, riid, ppv);
}
static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
return htmldoc_addref(This);
}
static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
return htmldoc_release(This);
}
static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
}
static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
}
static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
rgDispId);
}
static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%x)\n", This, fForce);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text,
IHTMLDOMNode **newTextNode)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
nsIDOMText *nstext;
HTMLDOMNode *node;
nsAString text_str;
nsresult nsres;
HRESULT hres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_InitDepend(&text_str, text);
nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext);
nsAString_Finish(&text_str);
if(NS_FAILED(nsres)) {
ERR("CreateTextNode failed: %08x\n", nsres);
return E_FAIL;
}
hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node);
nsIDOMText_Release(nstext);
if(FAILED(hres))
return hres;
*newTextNode = &node->IHTMLDOMNode_iface;
return S_OK;
}
static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
nsIDOMElement *nselem = NULL;
HTMLDOMNode *node;
nsresult nsres;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
if(This->window->readystate == READYSTATE_UNINITIALIZED) {
*p = NULL;
return S_OK;
}
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
if(NS_FAILED(nsres)) {
ERR("GetDocumentElement failed: %08x\n", nsres);
return E_FAIL;
}
if(!nselem) {
*p = NULL;
return S_OK;
}
hres = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE, &node);
nsIDOMElement_Release(nselem);
if(FAILED(hres))
return hres;
hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
node_release(node);
return hres;
}
static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event,
IDispatch* pDisp, VARIANT_BOOL *pfResult)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
return attach_event(&This->doc_node->node.event_target, This->doc_node->node.nsnode, This, event, pDisp, pfResult);
}
static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
IDispatch *pDisp)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
return detach_event(This->doc_node->node.event_target, This, event, pDisp);
}
static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->()\n", This);
return set_doc_event(This, EVENTID_CONTEXTMENU, &v);
}
static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->(%p)\n", This, p);
return get_doc_event(This, EVENTID_CONTEXTMENU, p);
}
static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface,
IHTMLDocument2 **ppNewDoc)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
nsIDOMDocumentFragment *doc_frag;
HTMLDocumentNode *docnode;
nsresult nsres;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, ppNewDoc);
if(!This->doc_node->nsdoc) {
FIXME("NULL nsdoc\n");
return E_NOTIMPL;
}
nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag);
if(NS_FAILED(nsres)) {
ERR("CreateDocumentFragment failed: %08x\n", nsres);
return E_FAIL;
}
hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode);
nsIDOMDocumentFragment_Release(doc_frag);
if(FAILED(hres))
return hres;
*ppNewDoc = &docnode->basedoc.IHTMLDocument2_iface;
return S_OK;
}
static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface,
IHTMLDocument2 **p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface,
VARIANT_BOOL v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface,
VARIANT_BOOL *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->(%p)\n", This, p);
return IHTMLDOMNode_get_childNodes(&This->doc_node->node.IHTMLDOMNode_iface, p);
}
static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface,
VARIANT_BOOL v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface,
VARIANT_BOOL *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v,
IHTMLElementCollection **ppelColl)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v,
IHTMLElement **pel)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
HTMLElement *elem;
HRESULT hres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
hres = get_doc_elem_by_id(This->doc_node, v, &elem);
if(FAILED(hres) || !elem) {
*pel = NULL;
return hres;
}
*pel = &elem->IHTMLElement_iface;
return S_OK;
}
static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v,
IHTMLElementCollection **pelColl)
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
nsIDOMNodeList *nslist;
nsAString id_str;
nsresult nsres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_InitDepend(&id_str, v);
nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->doc_node->nsdoc, &id_str, &nslist);
nsAString_Finish(&id_str);
if(FAILED(nsres)) {
ERR("GetElementByName failed: %08x\n", nsres);
return E_FAIL;
}
*pelColl = create_collection_from_nodelist(This->doc_node, nslist);
nsIDOMNodeList_Release(nslist);
return S_OK;
}
static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = {
HTMLDocument3_QueryInterface,
HTMLDocument3_AddRef,
HTMLDocument3_Release,
HTMLDocument3_GetTypeInfoCount,
HTMLDocument3_GetTypeInfo,
HTMLDocument3_GetIDsOfNames,
HTMLDocument3_Invoke,
HTMLDocument3_releaseCapture,
HTMLDocument3_recalc,
HTMLDocument3_createTextNode,
HTMLDocument3_get_documentElement,
HTMLDocument3_uniqueID,
HTMLDocument3_attachEvent,
HTMLDocument3_detachEvent,
HTMLDocument3_put_onrowsdelete,
HTMLDocument3_get_onrowsdelete,
HTMLDocument3_put_onrowsinserted,
HTMLDocument3_get_onrowsinserted,
HTMLDocument3_put_oncellchange,
HTMLDocument3_get_oncellchange,
HTMLDocument3_put_ondatasetchanged,
HTMLDocument3_get_ondatasetchanged,
HTMLDocument3_put_ondataavailable,
HTMLDocument3_get_ondataavailable,
HTMLDocument3_put_ondatasetcomplete,
HTMLDocument3_get_ondatasetcomplete,
HTMLDocument3_put_onpropertychange,
HTMLDocument3_get_onpropertychange,
HTMLDocument3_put_dir,
HTMLDocument3_get_dir,
HTMLDocument3_put_oncontextmenu,
HTMLDocument3_get_oncontextmenu,
HTMLDocument3_put_onstop,
HTMLDocument3_get_onstop,
HTMLDocument3_createDocumentFragment,
HTMLDocument3_get_parentDocument,
HTMLDocument3_put_enableDownload,
HTMLDocument3_get_enableDownload,
HTMLDocument3_put_baseUrl,
HTMLDocument3_get_baseUrl,
HTMLDocument3_get_childNodes,
HTMLDocument3_put_inheritStyleSheets,
HTMLDocument3_get_inheritStyleSheets,
HTMLDocument3_put_onbeforeeditfocus,
HTMLDocument3_get_onbeforeeditfocus,
HTMLDocument3_getElementsByName,
HTMLDocument3_getElementById,
HTMLDocument3_getElementsByTagName
};
static inline HTMLDocument *impl_from_IHTMLDocument4(IHTMLDocument4 *iface)
{
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument4_iface);
}
static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface,
REFIID riid, void **ppv)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
return htmldoc_query_interface(This, riid, ppv);
}
static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
return htmldoc_addref(This);
}
static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
return htmldoc_release(This);
}
static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
}
static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
}
static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
rgDispId);
}
static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
nsIDOMHTMLElement *nsbody;
nsresult nsres;
TRACE("(%p)->()\n", This);
nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
if(NS_FAILED(nsres) || !nsbody) {
ERR("GetBody failed: %08x\n", nsres);
return E_FAIL;
}
nsres = nsIDOMHTMLElement_Focus(nsbody);
nsIDOMHTMLElement_Release(nsbody);
if(NS_FAILED(nsres)) {
ERR("Focus failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%p)\n", This, pfFocus);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl,
BSTR bstrOptions, IHTMLDocument2 **newDoc)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface,
VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_variant(pvarEventObject), ppEventObj);
if(pvarEventObject && V_VT(pvarEventObject) != VT_ERROR && V_VT(pvarEventObject) != VT_EMPTY) {
FIXME("unsupported pvarEventObject %s\n", debugstr_variant(pvarEventObject));
return E_NOTIMPL;
}
return create_event_obj(ppEventObj);
}
static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName,
VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
return dispatch_event(&This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled);
}
static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v,
IHTMLRenderStyle **ppIHTMLRenderStyle)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p)
{
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = {
HTMLDocument4_QueryInterface,
HTMLDocument4_AddRef,
HTMLDocument4_Release,
HTMLDocument4_GetTypeInfoCount,
HTMLDocument4_GetTypeInfo,
HTMLDocument4_GetIDsOfNames,
HTMLDocument4_Invoke,
HTMLDocument4_focus,
HTMLDocument4_hasFocus,
HTMLDocument4_put_onselectionchange,
HTMLDocument4_get_onselectionchange,
HTMLDocument4_get_namespace,
HTMLDocument4_createDocumentFromUrl,
HTMLDocument4_put_media,
HTMLDocument4_get_media,
HTMLDocument4_createEventObject,
HTMLDocument4_fireEvent,
HTMLDocument4_createRenderStyle,
HTMLDocument4_put_oncontrolselect,
HTMLDocument4_get_oncontrolselect,
HTMLDocument4_get_URLEncoded
};
void HTMLDocument_HTMLDocument3_Init(HTMLDocument *This)
{
This->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl;
This->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl;
}

View file

@ -1,427 +0,0 @@
/*
* Copyright 2007 Jacek 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
* 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 "mshtml_private.h"
static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface)
{
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument5_iface);
}
static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface,
REFIID riid, void **ppv)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
return htmldoc_query_interface(This, riid, ppv);
}
static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
return htmldoc_addref(This);
}
static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
return htmldoc_release(This);
}
static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
}
static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
}
static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
rgDispId);
}
static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName,
IHTMLDOMAttribute **ppattribute)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
HTMLDOMAttribute *attr;
HRESULT hres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, &attr);
if(FAILED(hres))
return hres;
*ppattribute = &attr->IHTMLDOMAttribute_iface;
return S_OK;
}
static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata,
IHTMLDOMNode **ppRetNode)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
nsIDOMComment *nscomment;
HTMLElement *elem;
nsAString str;
nsresult nsres;
HRESULT hres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_InitDepend(&str, bstrdata);
nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment);
nsAString_Finish(&str);
if(NS_FAILED(nsres)) {
ERR("CreateTextNode failed: %08x\n", nsres);
return E_FAIL;
}
hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem);
nsIDOMComment_Release(nscomment);
if(FAILED(hres))
return hres;
*ppRetNode = &elem->node.IHTMLDOMNode_iface;
return S_OK;
}
static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
nsAString mode_str;
const PRUnichar *mode;
TRACE("(%p)->(%p)\n", This, p);
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsAString_Init(&mode_str, NULL);
nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str);
nsAString_GetData(&mode_str, &mode);
*p = SysAllocString(mode);
nsAString_Finish(&mode_str);
return S_OK;
}
static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
HTMLDocument5_QueryInterface,
HTMLDocument5_AddRef,
HTMLDocument5_Release,
HTMLDocument5_GetTypeInfoCount,
HTMLDocument5_GetTypeInfo,
HTMLDocument5_GetIDsOfNames,
HTMLDocument5_Invoke,
HTMLDocument5_put_onmousewheel,
HTMLDocument5_get_onmousewheel,
HTMLDocument5_get_doctype,
HTMLDocument5_get_implementation,
HTMLDocument5_createAttribute,
HTMLDocument5_createComment,
HTMLDocument5_put_onfocusin,
HTMLDocument5_get_onfocusin,
HTMLDocument5_put_onfocusout,
HTMLDocument5_get_onfocusout,
HTMLDocument5_put_onactivate,
HTMLDocument5_get_onactivate,
HTMLDocument5_put_ondeactivate,
HTMLDocument5_get_ondeactivate,
HTMLDocument5_put_onbeforeactivate,
HTMLDocument5_get_onbeforeactivate,
HTMLDocument5_put_onbeforedeactivate,
HTMLDocument5_get_onbeforedeactivate,
HTMLDocument5_get_compatMode
};
static inline HTMLDocument *impl_from_IHTMLDocument6(IHTMLDocument6 *iface)
{
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument6_iface);
}
static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface,
REFIID riid, void **ppv)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
return htmldoc_query_interface(This, riid, ppv);
}
static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
return htmldoc_addref(This);
}
static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
return htmldoc_release(This);
}
static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
}
static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
}
static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
rgDispId);
}
static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface,
IHTMLDocumentCompatibleInfoCollection **p)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface,
VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface,
VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface,
VARIANT *p)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface, VARIANT v)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
BSTR bstrId, IHTMLElement2 **p)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface)
{
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = {
HTMLDocument6_QueryInterface,
HTMLDocument6_AddRef,
HTMLDocument6_Release,
HTMLDocument6_GetTypeInfoCount,
HTMLDocument6_GetTypeInfo,
HTMLDocument6_GetIDsOfNames,
HTMLDocument6_Invoke,
HTMLDocument6_get_compatible,
HTMLDocument6_get_documentMode,
HTMLDocument6_put_onstorage,
HTMLDocument6_get_onstorage,
HTMLDocument6_put_onstoragecommit,
HTMLDocument6_get_onstoragecommit,
HTMLDocument6_getElementById,
HTMLDocument6_updateSettings
};
void HTMLDocument_HTMLDocument5_Init(HTMLDocument *This)
{
This->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl;
This->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl;
}

View file

@ -1710,8 +1710,8 @@ static HRESULT HTMLElement_invoke(DispatchEx *dispex, DISPID id, LCID lcid,
static HRESULT HTMLElement_populate_props(DispatchEx *dispex) static HRESULT HTMLElement_populate_props(DispatchEx *dispex)
{ {
HTMLElement *This = impl_from_DispatchEx(dispex); HTMLElement *This = impl_from_DispatchEx(dispex);
nsIDOMNamedNodeMap *attrs; nsIDOMMozNamedAttrMap *attrs;
nsIDOMNode *node; nsIDOMAttr *attr;
nsAString nsstr; nsAString nsstr;
const PRUnichar *str; const PRUnichar *str;
BSTR name; BSTR name;
@ -1729,40 +1729,40 @@ static HRESULT HTMLElement_populate_props(DispatchEx *dispex)
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
return E_FAIL; return E_FAIL;
nsres = nsIDOMNamedNodeMap_GetLength(attrs, &len); nsres = nsIDOMMozNamedAttrMap_GetLength(attrs, &len);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
nsIDOMNamedNodeMap_Release(attrs); nsIDOMMozNamedAttrMap_Release(attrs);
return E_FAIL; return E_FAIL;
} }
nsAString_Init(&nsstr, NULL); nsAString_Init(&nsstr, NULL);
for(i=0; i<len; i++) { for(i=0; i<len; i++) {
nsres = nsIDOMNamedNodeMap_Item(attrs, i, &node); nsres = nsIDOMMozNamedAttrMap_Item(attrs, i, &attr);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
continue; continue;
nsres = nsIDOMNode_GetNodeName(node, &nsstr); nsres = nsIDOMAttr_GetNodeName(attr, &nsstr);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
nsIDOMNode_Release(node); nsIDOMAttr_Release(attr);
continue; continue;
} }
nsAString_GetData(&nsstr, &str); nsAString_GetData(&nsstr, &str);
name = SysAllocString(str); name = SysAllocString(str);
if(!name) { if(!name) {
nsIDOMNode_Release(node); nsIDOMAttr_Release(attr);
continue; continue;
} }
hres = IDispatchEx_GetDispID(&dispex->IDispatchEx_iface, name, fdexNameCaseInsensitive, &id); hres = IDispatchEx_GetDispID(&dispex->IDispatchEx_iface, name, fdexNameCaseInsensitive, &id);
if(hres != DISP_E_UNKNOWNNAME) { if(hres != DISP_E_UNKNOWNNAME) {
nsIDOMNode_Release(node); nsIDOMAttr_Release(attr);
SysFreeString(name); SysFreeString(name);
continue; continue;
} }
nsres = nsIDOMNode_GetNodeValue(node, &nsstr); nsres = nsIDOMAttr_GetNodeValue(attr, &nsstr);
nsIDOMNode_Release(node); nsIDOMAttr_Release(attr);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
SysFreeString(name); SysFreeString(name);
continue; continue;
@ -1785,7 +1785,7 @@ static HRESULT HTMLElement_populate_props(DispatchEx *dispex)
} }
nsAString_Finish(&nsstr); nsAString_Finish(&nsstr);
nsIDOMNamedNodeMap_Release(attrs); nsIDOMMozNamedAttrMap_Release(attrs);
return S_OK; return S_OK;
} }

View file

@ -847,7 +847,7 @@ static HRESULT WINAPI HTMLElement2_attachEvent(IHTMLElement2 *iface, BSTR event,
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult); TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
return attach_event(get_node_event_target(&This->node), This->node.nsnode, &This->node.doc->basedoc, event, pDisp, pfResult); return attach_event(get_node_event_target(&This->node), &This->node.doc->basedoc, event, pDisp, pfResult);
} }
static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp) static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp)

View file

@ -25,7 +25,6 @@ typedef struct {
} handler_vector_t; } handler_vector_t;
struct event_target_t { struct event_target_t {
DWORD node_handlers_mask;
handler_vector_t *event_table[EVENTID_LAST]; handler_vector_t *event_table[EVENTID_LAST];
}; };
@ -142,13 +141,13 @@ typedef struct {
#define EVENT_DEFAULTLISTENER 0x0001 #define EVENT_DEFAULTLISTENER 0x0001
#define EVENT_BUBBLE 0x0002 #define EVENT_BUBBLE 0x0002
#define EVENT_FORWARDBODY 0x0004 #define EVENT_FORWARDBODY 0x0004
#define EVENT_NODEHANDLER 0x0008 #define EVENT_BIND_TO_BODY 0x0008
#define EVENT_CANCELABLE 0x0010 #define EVENT_CANCELABLE 0x0010
#define EVENT_HASDEFAULTHANDLERS 0x0020 #define EVENT_HASDEFAULTHANDLERS 0x0020
static const event_info_t event_info[] = { static const event_info_t event_info[] = {
{abortW, onabortW, EVENTT_NONE, DISPID_EVMETH_ONABORT, {abortW, onabortW, EVENTT_NONE, DISPID_EVMETH_ONABORT,
EVENT_NODEHANDLER}, EVENT_BIND_TO_BODY},
{beforeunloadW, onbeforeunloadW, EVENTT_NONE, DISPID_EVMETH_ONBEFOREUNLOAD, {beforeunloadW, onbeforeunloadW, EVENTT_NONE, DISPID_EVMETH_ONBEFOREUNLOAD,
EVENT_DEFAULTLISTENER|EVENT_FORWARDBODY}, EVENT_DEFAULTLISTENER|EVENT_FORWARDBODY},
{blurW, onblurW, EVENTT_HTML, DISPID_EVMETH_ONBLUR, {blurW, onblurW, EVENTT_HTML, DISPID_EVMETH_ONBLUR,
@ -168,7 +167,7 @@ static const event_info_t event_info[] = {
{dragstartW, ondragstartW, EVENTT_MOUSE, DISPID_EVMETH_ONDRAGSTART, {dragstartW, ondragstartW, EVENTT_MOUSE, DISPID_EVMETH_ONDRAGSTART,
EVENT_CANCELABLE}, EVENT_CANCELABLE},
{errorW, onerrorW, EVENTT_NONE, DISPID_EVMETH_ONERROR, {errorW, onerrorW, EVENTT_NONE, DISPID_EVMETH_ONERROR,
EVENT_NODEHANDLER}, EVENT_BIND_TO_BODY},
{focusW, onfocusW, EVENTT_HTML, DISPID_EVMETH_ONFOCUS, {focusW, onfocusW, EVENTT_HTML, DISPID_EVMETH_ONFOCUS,
EVENT_DEFAULTLISTENER}, EVENT_DEFAULTLISTENER},
{helpW, onhelpW, EVENTT_KEY, DISPID_EVMETH_ONHELP, {helpW, onhelpW, EVENTT_KEY, DISPID_EVMETH_ONHELP,
@ -180,7 +179,7 @@ static const event_info_t event_info[] = {
{keyupW, onkeyupW, EVENTT_KEY, DISPID_EVMETH_ONKEYUP, {keyupW, onkeyupW, EVENTT_KEY, DISPID_EVMETH_ONKEYUP,
EVENT_DEFAULTLISTENER|EVENT_BUBBLE}, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{loadW, onloadW, EVENTT_HTML, DISPID_EVMETH_ONLOAD, {loadW, onloadW, EVENTT_HTML, DISPID_EVMETH_ONLOAD,
EVENT_NODEHANDLER}, EVENT_BIND_TO_BODY},
{mousedownW, onmousedownW, EVENTT_MOUSE, DISPID_EVMETH_ONMOUSEDOWN, {mousedownW, onmousedownW, EVENTT_MOUSE, DISPID_EVMETH_ONMOUSEDOWN,
EVENT_DEFAULTLISTENER|EVENT_BUBBLE}, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{mousemoveW, onmousemoveW, EVENTT_MOUSE, DISPID_EVMETH_ONMOUSEMOVE, {mousemoveW, onmousemoveW, EVENTT_MOUSE, DISPID_EVMETH_ONMOUSEMOVE,
@ -205,8 +204,6 @@ static const event_info_t event_info[] = {
EVENT_DEFAULTLISTENER|EVENT_BUBBLE|EVENT_CANCELABLE} EVENT_DEFAULTLISTENER|EVENT_BUBBLE|EVENT_CANCELABLE}
}; };
static const eventid_t node_handled_list[] = { EVENTID_ABORT, EVENTID_ERROR, EVENTID_LOAD };
eventid_t str_to_eid(LPCWSTR str) eventid_t str_to_eid(LPCWSTR str)
{ {
int i; int i;
@ -232,19 +229,6 @@ static eventid_t attr_to_eid(LPCWSTR str)
return EVENTID_LAST; return EVENTID_LAST;
} }
static DWORD get_node_handler_mask(eventid_t eid)
{
DWORD i;
for(i=0; i<sizeof(node_handled_list)/sizeof(*node_handled_list); i++) {
if(node_handled_list[i] == eid)
return 1 << i;
}
ERR("Invalid eid %d\n", eid);
return ~0;
}
typedef struct { typedef struct {
DispatchEx dispex; DispatchEx dispex;
IHTMLEventObj IHTMLEventObj_iface; IHTMLEventObj IHTMLEventObj_iface;
@ -605,20 +589,48 @@ static HRESULT WINAPI HTMLEventObj_get_reason(IHTMLEventObj *iface, LONG *p)
static HRESULT WINAPI HTMLEventObj_get_x(IHTMLEventObj *iface, LONG *p) static HRESULT WINAPI HTMLEventObj_get_x(IHTMLEventObj *iface, LONG *p)
{ {
HTMLEventObj *This = impl_from_IHTMLEventObj(iface); HTMLEventObj *This = impl_from_IHTMLEventObj(iface);
LONG x = 0;
FIXME("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
*p = -1; if(This->nsevent) {
nsIDOMUIEvent *ui_event;
nsresult nsres;
nsres = nsIDOMEvent_QueryInterface(This->nsevent, &IID_nsIDOMUIEvent, (void**)&ui_event);
if(NS_SUCCEEDED(nsres)) {
/* NOTE: pageX is not exactly right here. */
nsres = nsIDOMUIEvent_GetPageX(ui_event, &x);
assert(nsres == NS_OK);
nsIDOMUIEvent_Release(ui_event);
}
}
*p = x;
return S_OK; return S_OK;
} }
static HRESULT WINAPI HTMLEventObj_get_y(IHTMLEventObj *iface, LONG *p) static HRESULT WINAPI HTMLEventObj_get_y(IHTMLEventObj *iface, LONG *p)
{ {
HTMLEventObj *This = impl_from_IHTMLEventObj(iface); HTMLEventObj *This = impl_from_IHTMLEventObj(iface);
LONG y = 0;
FIXME("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
*p = -1; if(This->nsevent) {
nsIDOMUIEvent *ui_event;
nsresult nsres;
nsres = nsIDOMEvent_QueryInterface(This->nsevent, &IID_nsIDOMUIEvent, (void**)&ui_event);
if(NS_SUCCEEDED(nsres)) {
/* NOTE: pageY is not exactly right here. */
nsres = nsIDOMUIEvent_GetPageY(ui_event, &y);
assert(nsres == NS_OK);
nsIDOMUIEvent_Release(ui_event);
}
}
*p = y;
return S_OK; return S_OK;
} }
@ -1292,31 +1304,33 @@ static BOOL alloc_handler_vector(event_target_t *event_target, eventid_t eid, in
return TRUE; return TRUE;
} }
static HRESULT ensure_nsevent_handler(HTMLDocumentNode *doc, event_target_t *event_target, nsIDOMNode *nsnode, eventid_t eid) static HRESULT ensure_nsevent_handler(HTMLDocumentNode *doc, event_target_t *event_target, eventid_t eid)
{ {
if(!doc->nsdoc) nsIDOMNode *nsnode = NULL;
TRACE("%s\n", debugstr_w(event_info[eid].name));
if(!doc->nsdoc || doc->event_vector[eid] || !(event_info[eid].flags & (EVENT_DEFAULTLISTENER|EVENT_BIND_TO_BODY)))
return S_OK; return S_OK;
if(event_info[eid].flags & EVENT_NODEHANDLER) { if(event_info[eid].flags & EVENT_BIND_TO_BODY) {
DWORD mask; nsIDOMHTMLElement *nsbody;
nsresult nsres;
mask = get_node_handler_mask(eid); nsres = nsIDOMHTMLDocument_GetBody(doc->nsdoc, &nsbody);
if(event_target->node_handlers_mask & mask) if(NS_SUCCEEDED(nsres) && nsbody) {
return S_OK; nsnode = (nsIDOMNode*)nsbody;
}else {
add_nsevent_listener(doc, nsnode, event_info[eid].name); ERR("GetBody failed: %08x\n", nsres);
event_target->node_handlers_mask |= mask; return E_UNEXPECTED;
return S_OK; }
} }
if(!(event_info[eid].flags & EVENT_DEFAULTLISTENER)) doc->event_vector[eid] = TRUE;
return S_OK; add_nsevent_listener(doc, nsnode, event_info[eid].name);
if(!doc->event_vector[eid]) {
doc->event_vector[eid] = TRUE;
add_nsevent_listener(doc, NULL, event_info[eid].name);
}
if(nsnode)
nsIDOMNode_Release(nsnode);
return S_OK; return S_OK;
} }
@ -1347,7 +1361,7 @@ static HRESULT remove_event_handler(event_target_t **event_target, eventid_t eid
return S_OK; return S_OK;
} }
static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, nsIDOMNode *nsnode, HTMLDocumentNode *doc, static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLDocumentNode *doc,
eventid_t eid, IDispatch *disp) eventid_t eid, IDispatch *disp)
{ {
event_target_t *event_target; event_target_t *event_target;
@ -1368,17 +1382,17 @@ static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, nsIDOMN
event_target->event_table[eid]->handler_prop = disp; event_target->event_table[eid]->handler_prop = disp;
IDispatch_AddRef(disp); IDispatch_AddRef(disp);
return ensure_nsevent_handler(doc, event_target, nsnode, eid); return ensure_nsevent_handler(doc, event_target, eid);
} }
HRESULT set_event_handler(event_target_t **event_target, nsIDOMNode *nsnode, HTMLDocumentNode *doc, eventid_t eid, VARIANT *var) HRESULT set_event_handler(event_target_t **event_target, HTMLDocumentNode *doc, eventid_t eid, VARIANT *var)
{ {
switch(V_VT(var)) { switch(V_VT(var)) {
case VT_NULL: case VT_NULL:
return remove_event_handler(event_target, eid); return remove_event_handler(event_target, eid);
case VT_DISPATCH: case VT_DISPATCH:
return set_event_handler_disp(event_target, nsnode, doc, eid, V_DISPATCH(var)); return set_event_handler_disp(event_target, doc, eid, V_DISPATCH(var));
default: default:
FIXME("not handler %s\n", debugstr_variant(var)); FIXME("not handler %s\n", debugstr_variant(var));
@ -1403,7 +1417,7 @@ HRESULT get_event_handler(event_target_t **event_target, eventid_t eid, VARIANT
return S_OK; return S_OK;
} }
HRESULT attach_event(event_target_t **event_target_ptr, nsIDOMNode *nsnode, HTMLDocument *doc, BSTR name, HRESULT attach_event(event_target_t **event_target_ptr, HTMLDocument *doc, BSTR name,
IDispatch *disp, VARIANT_BOOL *res) IDispatch *disp, VARIANT_BOOL *res)
{ {
event_target_t *event_target; event_target_t *event_target;
@ -1434,7 +1448,7 @@ HRESULT attach_event(event_target_t **event_target_ptr, nsIDOMNode *nsnode, HTML
event_target->event_table[eid]->handlers[i] = disp; event_target->event_table[eid]->handlers[i] = disp;
*res = VARIANT_TRUE; *res = VARIANT_TRUE;
return ensure_nsevent_handler(doc->doc_node, event_target, nsnode, eid); return ensure_nsevent_handler(doc->doc_node, event_target, eid);
} }
HRESULT detach_event(event_target_t *event_target, HTMLDocument *doc, BSTR name, IDispatch *disp) HRESULT detach_event(event_target_t *event_target, HTMLDocument *doc, BSTR name, IDispatch *disp)
@ -1465,11 +1479,11 @@ HRESULT detach_event(event_target_t *event_target, HTMLDocument *doc, BSTR name,
return S_OK; return S_OK;
} }
void bind_elem_event(HTMLDocumentNode *doc, HTMLElement *elem, const WCHAR *event, IDispatch *disp) void bind_node_event(HTMLDocumentNode *doc, event_target_t **event_target, HTMLDOMNode *node, const WCHAR *event, IDispatch *disp)
{ {
eventid_t eid; eventid_t eid;
TRACE("(%p %p %s %p)\n", doc, elem, debugstr_w(event), disp); TRACE("(%p %p %p %s %p)\n", doc, event_target, node, debugstr_w(event), disp);
eid = attr_to_eid(event); eid = attr_to_eid(event);
if(eid == EVENTID_LAST) { if(eid == EVENTID_LAST) {
@ -1477,10 +1491,10 @@ void bind_elem_event(HTMLDocumentNode *doc, HTMLElement *elem, const WCHAR *even
return; return;
} }
set_event_handler_disp(&elem->node.event_target, elem->node.nsnode, doc, eid, disp); set_event_handler_disp(event_target, doc, eid, disp);
} }
void update_cp_events(HTMLInnerWindow *window, event_target_t **event_target_ptr, cp_static_data_t *cp, nsIDOMNode *nsnode) void update_cp_events(HTMLInnerWindow *window, event_target_t **event_target_ptr, cp_static_data_t *cp)
{ {
event_target_t *event_target; event_target_t *event_target;
int i; int i;
@ -1491,7 +1505,7 @@ void update_cp_events(HTMLInnerWindow *window, event_target_t **event_target_ptr
for(i=0; i < EVENTID_LAST; i++) { for(i=0; i < EVENTID_LAST; i++) {
if((event_info[i].flags & EVENT_DEFAULTLISTENER) && is_cp_event(cp, event_info[i].dispid)) if((event_info[i].flags & EVENT_DEFAULTLISTENER) && is_cp_event(cp, event_info[i].dispid))
ensure_nsevent_handler(window->doc, event_target, nsnode, i); ensure_nsevent_handler(window->doc, event_target, i);
} }
} }
@ -1522,7 +1536,7 @@ void check_event_attr(HTMLDocumentNode *doc, nsIDOMElement *nselem)
if(disp) { if(disp) {
hres = get_node(doc, (nsIDOMNode*)nselem, TRUE, &node); hres = get_node(doc, (nsIDOMNode*)nselem, TRUE, &node);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
set_event_handler_disp(get_node_event_target(node), node->nsnode, node->doc, i, disp); set_event_handler_disp(get_node_event_target(node), node->doc, i, disp);
node_release(node); node_release(node);
} }
IDispatch_Release(disp); IDispatch_Release(disp);
@ -1547,7 +1561,7 @@ HRESULT doc_init_events(HTMLDocumentNode *doc)
for(i=0; i < EVENTID_LAST; i++) { for(i=0; i < EVENTID_LAST; i++) {
if(event_info[i].flags & EVENT_HASDEFAULTHANDLERS) { if(event_info[i].flags & EVENT_HASDEFAULTHANDLERS) {
hres = ensure_nsevent_handler(doc, NULL, NULL, i); hres = ensure_nsevent_handler(doc, NULL, i);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
} }

View file

@ -51,18 +51,18 @@ typedef enum {
eventid_t str_to_eid(LPCWSTR) DECLSPEC_HIDDEN; eventid_t str_to_eid(LPCWSTR) DECLSPEC_HIDDEN;
void check_event_attr(HTMLDocumentNode*,nsIDOMElement*) DECLSPEC_HIDDEN; void check_event_attr(HTMLDocumentNode*,nsIDOMElement*) DECLSPEC_HIDDEN;
void release_event_target(event_target_t*) DECLSPEC_HIDDEN; void release_event_target(event_target_t*) DECLSPEC_HIDDEN;
void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN; void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN;
HRESULT set_event_handler(event_target_t**,nsIDOMNode*,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN; HRESULT set_event_handler(event_target_t**,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
HRESULT get_event_handler(event_target_t**,eventid_t,VARIANT*) DECLSPEC_HIDDEN; HRESULT get_event_handler(event_target_t**,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
HRESULT attach_event(event_target_t**,nsIDOMNode*,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN; HRESULT attach_event(event_target_t**,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*) DECLSPEC_HIDDEN; HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*) DECLSPEC_HIDDEN;
HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*) DECLSPEC_HIDDEN; HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
HRESULT call_fire_event(HTMLDOMNode*,eventid_t) DECLSPEC_HIDDEN; HRESULT call_fire_event(HTMLDOMNode*,eventid_t) DECLSPEC_HIDDEN;
void update_cp_events(HTMLInnerWindow*,event_target_t**,cp_static_data_t*,nsIDOMNode*) DECLSPEC_HIDDEN; void update_cp_events(HTMLInnerWindow*,event_target_t**,cp_static_data_t*) DECLSPEC_HIDDEN;
HRESULT doc_init_events(HTMLDocumentNode*) DECLSPEC_HIDDEN; HRESULT doc_init_events(HTMLDocumentNode*) DECLSPEC_HIDDEN;
void detach_events(HTMLDocumentNode *doc) DECLSPEC_HIDDEN; void detach_events(HTMLDocumentNode *doc) DECLSPEC_HIDDEN;
HRESULT create_event_obj(IHTMLEventObj**) DECLSPEC_HIDDEN; HRESULT create_event_obj(IHTMLEventObj**) DECLSPEC_HIDDEN;
void bind_elem_event(HTMLDocumentNode*,HTMLElement*,const WCHAR*,IDispatch*) DECLSPEC_HIDDEN; void bind_node_event(HTMLDocumentNode*,event_target_t**,HTMLDOMNode*,const WCHAR*,IDispatch*) DECLSPEC_HIDDEN;
void init_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN; void init_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN;
void release_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN; void release_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN;
@ -76,7 +76,7 @@ static inline event_target_t **get_node_event_target(HTMLDOMNode *node)
static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
{ {
return set_event_handler(get_node_event_target(node), node->nsnode, node->doc, eid, var); return set_event_handler(get_node_event_target(node), node->doc, eid, var);
} }
static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)

View file

@ -346,17 +346,75 @@ static HRESULT WINAPI HTMLFormElement_get_onreset(IHTMLFormElement *iface, VARIA
static HRESULT WINAPI HTMLFormElement_submit(IHTMLFormElement *iface) static HRESULT WINAPI HTMLFormElement_submit(IHTMLFormElement *iface)
{ {
HTMLFormElement *This = impl_from_IHTMLFormElement(iface); HTMLFormElement *This = impl_from_IHTMLFormElement(iface);
HTMLOuterWindow *window = NULL, *this_window = NULL;
nsIInputStream *post_stream;
nsAString action_uri_str, target_str;
IUri *uri;
nsresult nsres; nsresult nsres;
HRESULT hres;
TRACE("(%p)->()\n", This); TRACE("(%p)->()\n", This);
nsres = nsIDOMHTMLFormElement_Submit(This->nsform); if(This->element.node.doc) {
if(NS_FAILED(nsres)) { HTMLDocumentNode *doc = This->element.node.doc;
ERR("Submit failed: %08x\n", nsres); if(doc->window && doc->window->base.outer_window)
return E_FAIL; this_window = doc->window->base.outer_window;
}
if(!this_window) {
TRACE("No outer window\n");
return S_OK;
} }
return S_OK; nsAString_Init(&target_str, NULL);
nsres = nsIDOMHTMLFormElement_GetTarget(This->nsform, &target_str);
if(NS_SUCCEEDED(nsres)) {
BOOL use_new_window;
window = get_target_window(this_window, &target_str, &use_new_window);
if(use_new_window)
FIXME("submit to new window is not supported\n");
}
nsAString_Finish(&target_str);
if(!window)
return S_OK;
/*
* FIXME: We currently don't use our submit implementation for sub-windows because
* load_nsuri can't support post data. We should fix it.
*/
if(!window->doc_obj || window->doc_obj->basedoc.window != window) {
nsres = nsIDOMHTMLFormElement_Submit(This->nsform);
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
if(NS_FAILED(nsres)) {
ERR("Submit failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
nsAString_Init(&action_uri_str, NULL);
nsres = nsIDOMHTMLFormElement_GetFormData(This->nsform, NULL, &action_uri_str, &post_stream);
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *action_uri;
nsAString_GetData(&action_uri_str, &action_uri);
hres = create_uri(action_uri, 0, &uri);
}else {
ERR("GetFormData failed: %08x\n", nsres);
hres = E_FAIL;
}
nsAString_Finish(&action_uri_str);
if(SUCCEEDED(hres)) {
window->readystate_locked++;
hres = submit_form(window, uri, post_stream);
window->readystate_locked--;
IUri_Release(uri);
}
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
if(post_stream)
nsIInputStream_Release(post_stream);
return hres;
} }
static HRESULT WINAPI HTMLFormElement_reset(IHTMLFormElement *iface) static HRESULT WINAPI HTMLFormElement_reset(IHTMLFormElement *iface)

View file

@ -578,15 +578,19 @@ static HRESULT WINAPI HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, I
static HRESULT WINAPI HTMLFrameBase2_put_onload(IHTMLFrameBase2 *iface, VARIANT v) static HRESULT WINAPI HTMLFrameBase2_put_onload(IHTMLFrameBase2 *iface, VARIANT v)
{ {
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface); HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL; TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_node_event(&This->element.node, EVENTID_LOAD, &v);
} }
static HRESULT WINAPI HTMLFrameBase2_get_onload(IHTMLFrameBase2 *iface, VARIANT *p) static HRESULT WINAPI HTMLFrameBase2_get_onload(IHTMLFrameBase2 *iface, VARIANT *p)
{ {
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface); HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; TRACE("(%p)->(%p)\n", This, p);
return get_node_event(&This->element.node, EVENTID_LOAD, p);
} }
static HRESULT WINAPI HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT v) static HRESULT WINAPI HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT v)

View file

@ -141,15 +141,28 @@ static HRESULT WINAPI HTMLSelectElement_get_size(IHTMLSelectElement *iface, LONG
static HRESULT WINAPI HTMLSelectElement_put_multiple(IHTMLSelectElement *iface, VARIANT_BOOL v) static HRESULT WINAPI HTMLSelectElement_put_multiple(IHTMLSelectElement *iface, VARIANT_BOOL v)
{ {
HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface); HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface);
FIXME("(%p)->(%x)\n", This, v); nsresult nsres;
return E_NOTIMPL;
TRACE("(%p)->(%x)\n", This, v);
nsres = nsIDOMHTMLSelectElement_SetMultiple(This->nsselect, !!v);
assert(nsres == NS_OK);
return S_OK;
} }
static HRESULT WINAPI HTMLSelectElement_get_multiple(IHTMLSelectElement *iface, VARIANT_BOOL *p) static HRESULT WINAPI HTMLSelectElement_get_multiple(IHTMLSelectElement *iface, VARIANT_BOOL *p)
{ {
HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface); HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface);
FIXME("(%p)->(%p)\n", This, p); cpp_bool val;
return E_NOTIMPL; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMHTMLSelectElement_GetMultiple(This->nsselect, &val);
assert(nsres == NS_OK);
*p = val ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
} }
static HRESULT WINAPI HTMLSelectElement_put_name(IHTMLSelectElement *iface, BSTR v) static HRESULT WINAPI HTMLSelectElement_put_name(IHTMLSelectElement *iface, BSTR v)

View file

@ -74,6 +74,9 @@ static const WCHAR attrBorderWidth[] =
{'b','o','r','d','e','r','-','w','i','d','t','h',0}; {'b','o','r','d','e','r','-','w','i','d','t','h',0};
static const WCHAR attrBottom[] = static const WCHAR attrBottom[] =
{'b','o','t','t','o','m',0}; {'b','o','t','t','o','m',0};
/* FIXME: Use unprefixed version (requires Gecko changes). */
static const WCHAR attrBoxSizing[] =
{'-','m','o','z','-','b','o','x','-','s','i','z','i','n','g',0};
static const WCHAR attrClear[] = static const WCHAR attrClear[] =
{'c','l','e','a','r',0}; {'c','l','e','a','r',0};
static const WCHAR attrClip[] = static const WCHAR attrClip[] =
@ -106,6 +109,8 @@ static const WCHAR attrLetterSpacing[] =
{'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0}; {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
static const WCHAR attrLineHeight[] = static const WCHAR attrLineHeight[] =
{'l','i','n','e','-','h','e','i','g','h','t',0}; {'l','i','n','e','-','h','e','i','g','h','t',0};
static const WCHAR attrListStyleType[] =
{'l','i','s','t','-','s','t','y','l','e','-','t','y','p','e',0};
static const WCHAR attrMargin[] = static const WCHAR attrMargin[] =
{'m','a','r','g','i','n',0}; {'m','a','r','g','i','n',0};
static const WCHAR attrMarginBottom[] = static const WCHAR attrMarginBottom[] =
@ -118,6 +123,8 @@ static const WCHAR attrMarginTop[] =
{'m','a','r','g','i','n','-','t','o','p',0}; {'m','a','r','g','i','n','-','t','o','p',0};
static const WCHAR attrMinHeight[] = static const WCHAR attrMinHeight[] =
{'m','i','n','-','h','e','i','g','h','t',0}; {'m','i','n','-','h','e','i','g','h','t',0};
static const WCHAR attrOutline[] =
{'o','u','t','l','i','n','e',0};
static const WCHAR attrOverflow[] = static const WCHAR attrOverflow[] =
{'o','v','e','r','f','l','o','w',0}; {'o','v','e','r','f','l','o','w',0};
static const WCHAR attrOverflowX[] = static const WCHAR attrOverflowX[] =
@ -202,6 +209,7 @@ static const style_tbl_entry_t style_tbl[] = {
{attrBorderTopWidth, DISPID_IHTMLSTYLE_BORDERTOPWIDTH}, {attrBorderTopWidth, DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
{attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH}, {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
{attrBottom, DISPID_IHTMLSTYLE2_BOTTOM}, {attrBottom, DISPID_IHTMLSTYLE2_BOTTOM},
{attrBoxSizing, DISPID_IHTMLSTYLE6_BOXSIZING},
{attrClear, DISPID_IHTMLSTYLE_CLEAR}, {attrClear, DISPID_IHTMLSTYLE_CLEAR},
{attrClip, DISPID_IHTMLSTYLE_CLIP}, {attrClip, DISPID_IHTMLSTYLE_CLIP},
{attrColor, DISPID_IHTMLSTYLE_COLOR}, {attrColor, DISPID_IHTMLSTYLE_COLOR},
@ -218,12 +226,14 @@ static const style_tbl_entry_t style_tbl[] = {
{attrLeft, DISPID_IHTMLSTYLE_LEFT}, {attrLeft, DISPID_IHTMLSTYLE_LEFT},
{attrLetterSpacing, DISPID_IHTMLSTYLE_LETTERSPACING}, {attrLetterSpacing, DISPID_IHTMLSTYLE_LETTERSPACING},
{attrLineHeight, DISPID_IHTMLSTYLE_LINEHEIGHT}, {attrLineHeight, DISPID_IHTMLSTYLE_LINEHEIGHT},
{attrListStyleType, DISPID_IHTMLSTYLE_LISTSTYLETYPE},
{attrMargin, DISPID_IHTMLSTYLE_MARGIN}, {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
{attrMarginBottom, DISPID_IHTMLSTYLE_MARGINBOTTOM}, {attrMarginBottom, DISPID_IHTMLSTYLE_MARGINBOTTOM},
{attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT}, {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
{attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT}, {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
{attrMarginTop, DISPID_IHTMLSTYLE_MARGINTOP}, {attrMarginTop, DISPID_IHTMLSTYLE_MARGINTOP},
{attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT}, {attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT},
{attrOutline, DISPID_IHTMLSTYLE6_OUTLINE},
{attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW}, {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
{attrOverflowX, DISPID_IHTMLSTYLE2_OVERFLOWX}, {attrOverflowX, DISPID_IHTMLSTYLE2_OVERFLOWX},
{attrOverflowY, DISPID_IHTMLSTYLE2_OVERFLOWY}, {attrOverflowY, DISPID_IHTMLSTYLE2_OVERFLOWY},
@ -447,7 +457,7 @@ static HRESULT nsstyle_to_bstr(const WCHAR *val, DWORD flags, BSTR *p)
DWORD len; DWORD len;
if(!*val) { if(!*val) {
*p = NULL; *p = (flags & ATTR_NO_NULL) ? SysAllocStringLen(NULL, 0) : NULL;
return S_OK; return S_OK;
} }
@ -2144,15 +2154,19 @@ static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v) static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
{ {
HTMLStyle *This = impl_from_IHTMLStyle(iface); HTMLStyle *This = impl_from_IHTMLStyle(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL; TRACE("(%p)->(%s)\n", This, debugstr_w(v));
return set_style_attr(This, STYLEID_LISTSTYLETYPE, v, 0);
} }
static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p) static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
{ {
HTMLStyle *This = impl_from_IHTMLStyle(iface); HTMLStyle *This = impl_from_IHTMLStyle(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; TRACE("(%p)->(%p)\n", This, p);
return get_style_attr(This, STYLEID_LISTSTYLETYPE, p);
} }
static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v) static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
@ -3091,11 +3105,9 @@ static dispex_static_data_t HTMLStyle_dispex = {
HTMLStyle_iface_tids HTMLStyle_iface_tids
}; };
HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret) static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration **ret)
{ {
nsIDOMElementCSSInlineStyle *nselemstyle; nsIDOMElementCSSInlineStyle *nselemstyle;
nsIDOMCSSStyleDeclaration *nsstyle;
HTMLStyle *style;
nsresult nsres; nsresult nsres;
if(!elem->nselem) { if(!elem->nselem) {
@ -3107,13 +3119,26 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
(void**)&nselemstyle); (void**)&nselemstyle);
assert(nsres == NS_OK); assert(nsres == NS_OK);
nsres = nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle, &nsstyle); nsres = nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle, ret);
nsIDOMElementCSSInlineStyle_Release(nselemstyle); nsIDOMElementCSSInlineStyle_Release(nselemstyle);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
ERR("GetStyle failed: %08x\n", nsres); ERR("GetStyle failed: %08x\n", nsres);
return E_FAIL; return E_FAIL;
} }
return S_OK;
}
HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
{
nsIDOMCSSStyleDeclaration *nsstyle;
HTMLStyle *style;
HRESULT hres;
hres = get_style_from_elem(elem, &nsstyle);
if(FAILED(hres))
return hres;
style = heap_alloc_zero(sizeof(HTMLStyle)); style = heap_alloc_zero(sizeof(HTMLStyle));
if(!style) { if(!style) {
nsIDOMCSSStyleDeclaration_Release(nsstyle); nsIDOMCSSStyleDeclaration_Release(nsstyle);
@ -3134,3 +3159,31 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
*ret = style; *ret = style;
return S_OK; return S_OK;
} }
HRESULT get_elem_style(HTMLElement *elem, styleid_t styleid, BSTR *ret)
{
nsIDOMCSSStyleDeclaration *style;
HRESULT hres;
hres = get_style_from_elem(elem, &style);
if(FAILED(hres))
return hres;
hres = get_nsstyle_attr(style, styleid, ret, 0);
nsIDOMCSSStyleDeclaration_Release(style);
return hres;
}
HRESULT set_elem_style(HTMLElement *elem, styleid_t styleid, const WCHAR *val)
{
nsIDOMCSSStyleDeclaration *style;
HRESULT hres;
hres = get_style_from_elem(elem, &style);
if(FAILED(hres))
return hres;
hres = set_nsstyle_attr(style, styleid, val, 0);
nsIDOMCSSStyleDeclaration_Release(style);
return hres;
}

View file

@ -61,6 +61,7 @@ typedef enum {
STYLEID_BORDER_TOP_WIDTH, STYLEID_BORDER_TOP_WIDTH,
STYLEID_BORDER_WIDTH, STYLEID_BORDER_WIDTH,
STYLEID_BOTTOM, STYLEID_BOTTOM,
STYLEID_BOX_SIZING,
STYLEID_CLEAR, STYLEID_CLEAR,
STYLEID_CLIP, STYLEID_CLIP,
STYLEID_COLOR, STYLEID_COLOR,
@ -77,12 +78,14 @@ typedef enum {
STYLEID_LEFT, STYLEID_LEFT,
STYLEID_LETTER_SPACING, STYLEID_LETTER_SPACING,
STYLEID_LINE_HEIGHT, STYLEID_LINE_HEIGHT,
STYLEID_LISTSTYLETYPE,
STYLEID_MARGIN, STYLEID_MARGIN,
STYLEID_MARGIN_BOTTOM, STYLEID_MARGIN_BOTTOM,
STYLEID_MARGIN_LEFT, STYLEID_MARGIN_LEFT,
STYLEID_MARGIN_RIGHT, STYLEID_MARGIN_RIGHT,
STYLEID_MARGIN_TOP, STYLEID_MARGIN_TOP,
STYLEID_MIN_HEIGHT, STYLEID_MIN_HEIGHT,
STYLEID_OUTLINE,
STYLEID_OVERFLOW, STYLEID_OVERFLOW,
STYLEID_OVERFLOW_X, STYLEID_OVERFLOW_X,
STYLEID_OVERFLOW_Y, STYLEID_OVERFLOW_Y,
@ -118,8 +121,12 @@ HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration*,styleid_t,LPCWSTR,DWORD) DEC
HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags) DECLSPEC_HIDDEN; HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags) DECLSPEC_HIDDEN;
HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags) DECLSPEC_HIDDEN; HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags) DECLSPEC_HIDDEN;
HRESULT get_elem_style(HTMLElement*,styleid_t,BSTR*) DECLSPEC_HIDDEN;
HRESULT set_elem_style(HTMLElement*,styleid_t,const WCHAR*) DECLSPEC_HIDDEN;
#define ATTR_FIX_PX 0x0001 #define ATTR_FIX_PX 0x0001
#define ATTR_FIX_URL 0x0002 #define ATTR_FIX_URL 0x0002
#define ATTR_STR_TO_INT 0x0004 #define ATTR_STR_TO_INT 0x0004
#define ATTR_HEX_INT 0x0008 #define ATTR_HEX_INT 0x0008
#define ATTR_REMOVE_COMMA 0x0010 #define ATTR_REMOVE_COMMA 0x0010
#define ATTR_NO_NULL 0x0020

View file

@ -688,15 +688,19 @@ static HRESULT WINAPI HTMLStyle6_get_counterReset(IHTMLStyle6 *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle6_put_outline(IHTMLStyle6 *iface, BSTR v) static HRESULT WINAPI HTMLStyle6_put_outline(IHTMLStyle6 *iface, BSTR v)
{ {
HTMLStyle *This = impl_from_IHTMLStyle6(iface); HTMLStyle *This = impl_from_IHTMLStyle6(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL; TRACE("(%p)->(%s)\n", This, debugstr_w(v));
return set_nsstyle_attr(This->nsstyle, STYLEID_OUTLINE, v, 0);
} }
static HRESULT WINAPI HTMLStyle6_get_outline(IHTMLStyle6 *iface, BSTR *p) static HRESULT WINAPI HTMLStyle6_get_outline(IHTMLStyle6 *iface, BSTR *p)
{ {
HTMLStyle *This = impl_from_IHTMLStyle6(iface); HTMLStyle *This = impl_from_IHTMLStyle6(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; TRACE("(%p)->(%p)\n", This, p);
return get_nsstyle_attr(This->nsstyle, STYLEID_OUTLINE, p, ATTR_NO_NULL);
} }
static HRESULT WINAPI HTMLStyle6_put_outlineWidth(IHTMLStyle6 *iface, VARIANT v) static HRESULT WINAPI HTMLStyle6_put_outlineWidth(IHTMLStyle6 *iface, VARIANT v)
@ -744,15 +748,19 @@ static HRESULT WINAPI HTMLStyle6_get_outlineColor(IHTMLStyle6 *iface, VARIANT *p
static HRESULT WINAPI HTMLStyle6_put_boxSizing(IHTMLStyle6 *iface, BSTR v) static HRESULT WINAPI HTMLStyle6_put_boxSizing(IHTMLStyle6 *iface, BSTR v)
{ {
HTMLStyle *This = impl_from_IHTMLStyle6(iface); HTMLStyle *This = impl_from_IHTMLStyle6(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL; TRACE("(%p)->(%s)\n", This, debugstr_w(v));
return set_nsstyle_attr(This->nsstyle, STYLEID_BOX_SIZING, v, 0);
} }
static HRESULT WINAPI HTMLStyle6_get_boxSizing(IHTMLStyle6 *iface, BSTR *p) static HRESULT WINAPI HTMLStyle6_get_boxSizing(IHTMLStyle6 *iface, BSTR *p)
{ {
HTMLStyle *This = impl_from_IHTMLStyle6(iface); HTMLStyle *This = impl_from_IHTMLStyle6(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; TRACE("(%p)->(%p)\n", This, p);
return get_nsstyle_attr(This->nsstyle, STYLEID_BOX_SIZING, p, 0);
} }
static HRESULT WINAPI HTMLStyle6_put_boxSpacing(IHTMLStyle6 *iface, BSTR v) static HRESULT WINAPI HTMLStyle6_put_boxSpacing(IHTMLStyle6 *iface, BSTR v)

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