/********************************************************************** * OpenURL (SHDOCVW.@) */ void WINAPI OpenURL(HWND hWnd, HINSTANCE hInst, LPCSTR lpcstrUrl, int nShowCmd) { FIXME("%p %p %s %d\n", hWnd, hInst, debugstr_a(lpcstrUrl), nShowCmd); }
static void user_warning_fn(png_structp png_ptr, png_const_charp warning_message) { WARN("PNG warning: %s\n", debugstr_a(warning_message)); }
/********************************************************************* * SetCalendarInfoA (KERNEL32.@) * */ int WINAPI SetCalendarInfoA(LCID Locale, CALID Calendar, CALTYPE CalType, LPCSTR lpCalData) { FIXME("(%08x,%08x,%08x,%s): stub\n", Locale, Calendar, CalType, debugstr_a(lpCalData)); return 0; }
/************************************************************************* * BrsFolderDlgProc32 (not an exported API function) */ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { browse_info *info; TRACE("hwnd=%p msg=%04x 0x%08lx 0x%08lx\n", hWnd, msg, wParam, lParam ); if (msg == WM_INITDIALOG) return BrsFolder_OnCreate( hWnd, (browse_info*) lParam ); info = GetPropW( hWnd, szBrowseFolderInfo ); switch (msg) { case WM_NOTIFY: return BrsFolder_OnNotify( info, (UINT)wParam, (LPNMHDR)lParam); case WM_COMMAND: return BrsFolder_OnCommand( info, wParam ); case WM_WINDOWPOSCHANGING: return BrsFolder_OnWindowPosChanging( info, (WINDOWPOS *)lParam); case WM_SIZE: if (info->layout) /* new style dialogs */ LayoutUpdate(hWnd, info->layout, g_layout_info, LAYOUT_INFO_COUNT); return 0; case BFFM_SETSTATUSTEXTA: TRACE("Set status %s\n", debugstr_a((LPSTR)lParam)); SetWindowTextA(GetDlgItem(hWnd, IDD_STATUS), (LPSTR)lParam); break; case BFFM_SETSTATUSTEXTW: TRACE("Set status %s\n", debugstr_w((LPWSTR)lParam)); SetWindowTextW(GetDlgItem(hWnd, IDD_STATUS), (LPWSTR)lParam); break; case BFFM_ENABLEOK: TRACE("Enable %ld\n", lParam); EnableWindow(GetDlgItem(hWnd, 1), lParam != 0); break; case BFFM_SETOKTEXT: /* unicode only */ TRACE("Set OK text %s\n", debugstr_w((LPWSTR)lParam)); SetWindowTextW(GetDlgItem(hWnd, 1), (LPWSTR)lParam); break; case BFFM_SETSELECTIONA: return BrsFolder_OnSetSelectionA(info, (LPVOID)lParam, (BOOL)wParam); case BFFM_SETSELECTIONW: return BrsFolder_OnSetSelectionW(info, (LPVOID)lParam, (BOOL)wParam); case BFFM_SETEXPANDED: /* unicode only */ return BrsFolder_OnSetExpanded(info, (LPVOID)lParam, (BOOL)wParam, NULL); case WM_DESTROY: return BrsFolder_OnDestroy(info); } return FALSE; }
/*********************************************************************** * PrintHTML (MSHTML.@) */ void WINAPI PrintHTML(HWND hwnd, HINSTANCE handle, LPCSTR cmdline, INT show) { FIXME("(%p %p %s %x)\n", hwnd, handle, debugstr_a(cmdline), show); }
static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) { FILE_IN_CABINET_INFO_W fici; PSC_HSC_W phsc; CABINET_INFO_W ci; FILEPATHS_W fp; UINT err; int len; WCHAR mysterio[SIZEOF_MYSTERIO]; /* how big? undocumented! */ WCHAR buf[MAX_PATH], buf2[MAX_PATH]; CHAR charbuf[MAX_PATH]; memset(&(mysterio[0]), 0, SIZEOF_MYSTERIO * sizeof(WCHAR)); memset(&(buf[0]), 0, MAX_PATH * sizeof(WCHAR)); memset(&(buf2[0]), 0, MAX_PATH * sizeof(WCHAR)); memset(&(charbuf[0]), 0, MAX_PATH); TRACE("(fdint == %d, pfdin == ^%p)\n", fdint, pfdin); if (pfdin && pfdin->pv && (*((void **) pfdin->pv) == (void *)SC_HSC_W_MAGIC)) phsc = pfdin->pv; else { ERR("pv %p is not an SC_HSC_W.\n", (pfdin) ? pfdin->pv : NULL); return -1; } switch (fdint) { case fdintCABINET_INFO: TRACE("Cabinet info notification\n"); /* TRACE(" Cabinet name: %s\n", debugstr_a(pfdin->psz1)); TRACE(" Cabinet disk: %s\n", debugstr_a(pfdin->psz2)); TRACE(" Cabinet path: %s\n", debugstr_a(pfdin->psz3)); TRACE(" Cabinet Set#: %d\n", pfdin->setID); TRACE(" Cabinet Cab#: %d\n", pfdin->iCabinet); */ WARN("SPFILENOTIFY_CABINETINFO undocumented: guess implementation.\n"); ci.CabinetFile = &(phsc->most_recent_cabinet_name[0]); len = 1 + MultiByteToWideChar(CP_ACP, 0, pfdin->psz3, -1, &(buf[0]), MAX_PATH); if ((len > MAX_PATH) || (len <= 1)) buf[0] = '\0'; ci.CabinetPath = &(buf[0]); len = 1 + MultiByteToWideChar(CP_ACP, 0, pfdin->psz2, -1, &(buf2[0]), MAX_PATH); if ((len > MAX_PATH) || (len <= 1)) buf2[0] = '\0'; ci.DiskName = &(buf2[0]); ci.SetId = pfdin->setID; ci.CabinetNumber = pfdin->iCabinet; phsc->msghandler(phsc->context, SPFILENOTIFY_CABINETINFO, (UINT_PTR)&ci, 0); return 0; case fdintPARTIAL_FILE: TRACE("Partial file notification\n"); /* TRACE(" Partial file name: %s\n", debugstr_a(pfdin->psz1)); */ return 0; case fdintCOPY_FILE: TRACE("Copy file notification\n"); TRACE(" File name: %s\n", debugstr_a(pfdin->psz1)); /* TRACE(" File size: %ld\n", pfdin->cb); TRACE(" File date: %u\n", pfdin->date); TRACE(" File time: %u\n", pfdin->time); TRACE(" File attr: %u\n", pfdin->attribs); */ len = 1 + MultiByteToWideChar(CP_ACP, 0, pfdin->psz1, -1, &(buf2[0]), MAX_PATH); if ((len > MAX_PATH) || (len <= 1)) buf2[0] = '\0'; fici.NameInCabinet = &(buf2[0]); fici.FileSize = pfdin->cb; fici.Win32Error = 0; fici.DosDate = pfdin->date; fici.DosTime = pfdin->time; fici.DosAttribs = pfdin->attribs; memset(&(fici.FullTargetName[0]), 0, MAX_PATH * sizeof(WCHAR)); err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEINCABINET, (UINT_PTR)&fici, (UINT_PTR)pfdin->psz1); if (err == FILEOP_DOIT) { TRACE(" Callback specified filename: %s\n", debugstr_w(&(fici.FullTargetName[0]))); if (fici.FullTargetName[0]) { len = strlenW(&(fici.FullTargetName[0])) + 1; if ((len > MAX_PATH ) || (len <= 1)) return 0; if (!WideCharToMultiByte(CP_ACP, 0, &(fici.FullTargetName[0]), len, &(charbuf[0]), MAX_PATH, 0, 0)) return 0; } else { WARN("Empty buffer string caused abort.\n"); SetLastError(ERROR_PATH_NOT_FOUND); return -1; } return sc_cb_open(&(charbuf[0]), _O_BINARY | _O_CREAT | _O_WRONLY, _S_IREAD | _S_IWRITE); } else { TRACE(" Callback skipped file.\n"); return 0; } case fdintCLOSE_FILE_INFO: TRACE("Close file notification\n"); /* TRACE(" File name: %s\n", debugstr_a(pfdin->psz1)); TRACE(" Exec file? %s\n", (pfdin->cb) ? "Yes" : "No"); TRACE(" File hndl: %d\n", pfdin->hf); */ fp.Source = &(phsc->most_recent_cabinet_name[0]); len = 1 + MultiByteToWideChar(CP_ACP, 0, pfdin->psz1, -1, &(buf[0]), MAX_PATH); if ((len > MAX_PATH) || (len <= 1)) buf[0] = '\0'; fp.Target = &(buf[0]); fp.Win32Error = 0; fp.Flags = 0; /* a valid fixme -- but occurs too many times */ /* FIXME("Should set file date/time/attribs (and execute files?)\n"); */ err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEEXTRACTED, (UINT_PTR)&fp, 0); if (sc_cb_close(pfdin->hf)) WARN("_close failed.\n"); if (err) { SetLastError(err); return FALSE; } else return TRUE; case fdintNEXT_CABINET: TRACE("Next cabinet notification\n"); /* TRACE(" Cabinet name: %s\n", debugstr_a(pfdin->psz1)); TRACE(" Cabinet disk: %s\n", debugstr_a(pfdin->psz2)); TRACE(" Cabinet path: %s\n", debugstr_a(pfdin->psz3)); TRACE(" Cabinet Set#: %d\n", pfdin->setID); TRACE(" Cabinet Cab#: %d\n", pfdin->iCabinet); */ /* remember the new cabinet name */ len = 1 + MultiByteToWideChar(CP_ACP, 0, pfdin->psz1, -1, &(phsc->most_recent_cabinet_name[0]), MAX_PATH); if ((len > MAX_PATH) || (len <= 1)) phsc->most_recent_cabinet_name[0] = '\0'; ci.CabinetFile = &(phsc->most_recent_cabinet_name[0]); len = 1 + MultiByteToWideChar(CP_ACP, 0, pfdin->psz3, -1, &(buf[0]), MAX_PATH); if ((len > MAX_PATH) || (len <= 1)) buf[0] = '\0'; ci.CabinetPath = &(buf[0]); len = 1 + MultiByteToWideChar(CP_ACP, 0, pfdin->psz2, -1, &(buf2[0]), MAX_PATH); if ((len > MAX_PATH) || (len <= 1)) buf2[0] = '\0'; ci.DiskName = &(buf2[0]); ci.SetId = pfdin->setID; ci.CabinetNumber = pfdin->iCabinet; err = phsc->msghandler(phsc->context, SPFILENOTIFY_NEEDNEWCABINET, (UINT_PTR)&ci, (UINT_PTR)mysterio); if (err) { SetLastError(err); return -1; } else { if (mysterio[0]) { len = strlenW(&(mysterio[0])) + 1; if ((len > 255) || (len <= 1)) return 0; if (!WideCharToMultiByte(CP_ACP, 0, &(mysterio[0]), len, pfdin->psz3, 255, 0, 0)) return 0; } return 0; } default: FIXME("Unknown notification type %d.\n", fdint); return 0; } }
/****************************************************************************** * StartTraceA [ADVAPI32.@] * * See StartTraceW. * */ ULONG WINAPI StartTraceA( PTRACEHANDLE pSessionHandle, LPCSTR SessionName, PEVENT_TRACE_PROPERTIES Properties ) { FIXME("(%p, %s, %p) stub\n", pSessionHandle, debugstr_a(SessionName), Properties); if (pSessionHandle) *pSessionHandle = 0xcafe4242; return ERROR_SUCCESS; }
/************************************************************ * WTSEnumerateServersA (WTSAPI32.@) */ BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA *ppServerInfo, DWORD *pCount) { FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_a(pDomainName), Reserved, Version, ppServerInfo, pCount); return FALSE; }
/************************************************************ * WTSOpenServerA (WTSAPI32.@) */ HANDLE WINAPI WTSOpenServerA(LPSTR pServerName) { FIXME("(%s) stub\n", debugstr_a(pServerName)); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return NULL; }
const char* CDECL wine_pcap_lib_version(void) { const char* ret = pcap_lib_version(); TRACE("%s\n", debugstr_a(ret)); return ret; }
/*********************************************************************** * wvsnprintfA (internal) */ static INT wvsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, __ms_va_list args ) { WPRINTF_FORMAT format; LPSTR p = buffer; UINT i, len, sign; CHAR number[21]; /* 64bit number can be 18446744073709551616 which is 20 chars. and a \0 */ WPRINTF_DATA argData; TRACE("%p %u %s\n", buffer, maxlen, debugstr_a(spec)); while (*spec && (maxlen > 1)) { if (*spec != '%') { *p++ = *spec++; maxlen--; continue; } spec++; if (*spec == '%') { *p++ = *spec++; maxlen--; continue; } spec += WPRINTF_ParseFormatA( spec, &format ); switch(format.type) { case WPR_WCHAR: argData.wchar_view = (WCHAR)va_arg( args, int ); break; case WPR_CHAR: argData.char_view = (CHAR)va_arg( args, int ); break; case WPR_STRING: argData.lpcstr_view = va_arg( args, LPCSTR ); break; case WPR_WSTRING: argData.lpcwstr_view = va_arg( args, LPCWSTR ); break; case WPR_HEXA: case WPR_SIGNED: case WPR_UNSIGNED: if (format.flags & WPRINTF_INTPTR) argData.int_view = va_arg(args, INT_PTR); else if (format.flags & WPRINTF_I64) argData.int_view = va_arg(args, LONGLONG); else argData.int_view = va_arg(args, INT); break; default: argData.wchar_view = 0; break; } len = WPRINTF_GetLen( &format, &argData, number, maxlen - 1 ); sign = 0; if (!(format.flags & WPRINTF_LEFTALIGN)) for (i = format.precision; i < format.width; i++, maxlen--) *p++ = ' '; switch(format.type) { case WPR_WCHAR: *p++ = argData.wchar_view; break; case WPR_CHAR: *p++ = argData.char_view; break; case WPR_STRING: memcpy( p, argData.lpcstr_view, len ); p += len; break; case WPR_WSTRING: { LPCWSTR ptr = argData.lpcwstr_view; for (i = 0; i < len; i++) *p++ = (CHAR)*ptr++; } break; case WPR_HEXA: if ((format.flags & WPRINTF_PREFIX_HEX) && (maxlen > 3)) { *p++ = '0'; *p++ = (format.flags & WPRINTF_UPPER_HEX) ? 'X' : 'x'; maxlen -= 2; len -= 2; } /* fall through */ case WPR_SIGNED: /* Transfer the sign now, just in case it will be zero-padded*/ if (number[0] == '-') { *p++ = '-'; sign = 1; } /* fall through */ case WPR_UNSIGNED: for (i = len; i < format.precision; i++, maxlen--) *p++ = '0'; memcpy( p, number + sign, len - sign ); p += len - sign; break; case WPR_UNKNOWN: continue; } if (format.flags & WPRINTF_LEFTALIGN) for (i = format.precision; i < format.width; i++, maxlen--) *p++ = ' '; maxlen -= len; } *p = 0; TRACE("%s\n",debugstr_a(buffer)); return (maxlen > 1) ? (INT)(p - buffer) : -1; }
static int xrandr12_init_modes(void) { unsigned int only_one_resolution = 1, mode_count; XRRScreenResources *resources; XRROutputInfo *output_info; XRRCrtcInfo *crtc_info; int ret = -1; int i, j; if (!(resources = pXRRGetScreenResourcesCurrent( gdi_display, root_window ))) { ERR("Failed to get screen resources.\n"); return ret; } if (!resources->ncrtc) { pXRRFreeScreenResources( resources ); if (!(resources = pXRRGetScreenResources( gdi_display, root_window ))) { ERR("Failed to get screen resources.\n"); return ret; } } if (!(crtc_info = xrandr12_get_primary_crtc_info( resources, &primary_crtc ))) { pXRRFreeScreenResources( resources ); ERR("Failed to get primary CRTC info.\n"); return ret; } TRACE("CRTC %d: mode %#lx, %ux%u+%d+%d.\n", primary_crtc, crtc_info->mode, crtc_info->width, crtc_info->height, crtc_info->x, crtc_info->y); if (!crtc_info->noutput || !(output_info = pXRRGetOutputInfo( gdi_display, resources, crtc_info->outputs[0] ))) { pXRRFreeCrtcInfo( crtc_info ); pXRRFreeScreenResources( resources ); ERR("Failed to get output info.\n"); return ret; } TRACE("OUTPUT 0: name %s.\n", debugstr_a(output_info->name)); if (!output_info->nmode) { ERR("Output has no modes.\n"); goto done; } if (!(xrandr12_modes = HeapAlloc( GetProcessHeap(), 0, sizeof(*xrandr12_modes) * output_info->nmode ))) { ERR("Failed to allocate xrandr mode info array.\n"); goto done; } dd_modes = X11DRV_Settings_SetHandlers( "XRandR 1.2", xrandr12_get_current_mode, xrandr12_set_current_mode, output_info->nmode, 1 ); xrandr_mode_count = 0; for (i = 0; i < output_info->nmode; ++i) { for (j = 0; j < resources->nmode; ++j) { XRRModeInfo *mode = &resources->modes[j]; if (mode->id == output_info->modes[i]) { unsigned int dots = mode->hTotal * mode->vTotal; unsigned int refresh = dots ? (mode->dotClock + dots / 2) / dots : 0; TRACE("Adding mode %#lx: %ux%u@%u.\n", mode->id, mode->width, mode->height, refresh); X11DRV_Settings_AddOneMode( mode->width, mode->height, 0, refresh ); xrandr12_modes[xrandr_mode_count++] = mode->id; break; } } } mode_count = X11DRV_Settings_GetModeCount(); for (i = 1; i < mode_count; ++i) { if (dd_modes[i].width != dd_modes[0].width || dd_modes[i].height != dd_modes[0].height) { only_one_resolution = 0; break; } } /* Recent (304.64, possibly earlier) versions of the nvidia driver only * report a DFP's native mode through RandR 1.2 / 1.3. Standard DMT modes * are only listed through RandR 1.0 / 1.1. This is completely useless, * but NVIDIA considers this a feature, so it's unlikely to change. The * best we can do is to fall back to RandR 1.0 and encourage users to * consider more cooperative driver vendors when we detect such a * configuration. */ if (only_one_resolution && XQueryExtension( gdi_display, "NV-CONTROL", &i, &j, &ret )) { ERR_(winediag)("Broken NVIDIA RandR detected, falling back to RandR 1.0. " "Please consider using the Nouveau driver instead.\n"); ret = -1; HeapFree( GetProcessHeap(), 0, xrandr12_modes ); goto done; } X11DRV_Settings_AddDepthModes(); ret = 0; done: pXRRFreeOutputInfo( output_info ); pXRRFreeCrtcInfo( crtc_info ); pXRRFreeScreenResources( resources ); return ret; }
/************************************************************************* * @ [SHLWAPI.247] * * Log the start of an applet. * * PARAMS * lpszName [I] Name of the applet * * RETURNS * Nothing. */ void WINAPI StopWatch_MarkFrameStart(LPCSTR lpszName) { FIXME("(%s) stub!\n", debugstr_a(lpszName)); }
/*** IDirectXFile methods ***/ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPVOID pvSource, DXFILELOADOPTIONS dwLoadOptions, LPDIRECTXFILEENUMOBJECT* ppEnumObj) { IDirectXFileImpl *This = impl_from_IDirectXFile(iface); IDirectXFileEnumObjectImpl* object; HRESULT hr; LPBYTE file_buffer; DWORD file_size; DWORD bytes_written; TRACE("(%p/%p)->(%p,%x,%p)\n", This, iface, pvSource, dwLoadOptions, ppEnumObj); if (!ppEnumObj) return DXFILEERR_BADVALUE; /* Only lowest 4 bits are relevant in DXFILELOADOPTIONS */ dwLoadOptions &= 0xF; hr = IDirectXFileEnumObjectImpl_Create(&object); if (FAILED(hr)) return hr; if (dwLoadOptions == DXFILELOAD_FROMFILE) { HANDLE hFile, file_mapping; TRACE("Open source file '%s'\n", (char*)pvSource); hFile = CreateFileA(pvSource, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if (hFile == INVALID_HANDLE_VALUE) { TRACE("File '%s' not found\n", (char*)pvSource); return DXFILEERR_FILENOTFOUND; } file_size = GetFileSize(hFile, NULL); file_mapping = CreateFileMappingA(hFile, NULL, PAGE_READONLY, 0, 0, NULL); CloseHandle(hFile); if (!file_mapping) { hr = DXFILEERR_BADFILETYPE; goto error; } object->mapped_memory = MapViewOfFile(file_mapping, FILE_MAP_READ, 0, 0, 0); CloseHandle(file_mapping); if (!object->mapped_memory) { hr = DXFILEERR_BADFILETYPE; goto error; } file_buffer = object->mapped_memory; } else if (dwLoadOptions == DXFILELOAD_FROMRESOURCE) { HRSRC resource_info; HGLOBAL resource_data; LPDXFILELOADRESOURCE lpdxflr = pvSource; TRACE("Source in resource (module = %p, name = %s, type = %s)\n", lpdxflr->hModule, debugstr_a(lpdxflr->lpName), debugstr_a(lpdxflr->lpType)); resource_info = FindResourceA(lpdxflr->hModule, lpdxflr->lpName, lpdxflr->lpType); if (!resource_info) { hr = DXFILEERR_RESOURCENOTFOUND; goto error; } file_size = SizeofResource(lpdxflr->hModule, resource_info); resource_data = LoadResource(lpdxflr->hModule, resource_info); if (!resource_data) { hr = DXFILEERR_BADRESOURCE; goto error; } file_buffer = LockResource(resource_data); if (!file_buffer) { hr = DXFILEERR_BADRESOURCE; goto error; } } else if (dwLoadOptions == DXFILELOAD_FROMMEMORY) { LPDXFILELOADMEMORY lpdxflm = pvSource; TRACE("Source in memory at %p with size %d\n", lpdxflm->lpMemory, lpdxflm->dSize); file_buffer = lpdxflm->lpMemory; file_size = lpdxflm->dSize; } else { FIXME("Source type %d is not handled yet\n", dwLoadOptions); hr = DXFILEERR_NOTDONEYET; goto error; } TRACE("File size is %d bytes\n", file_size); if (TRACE_ON(d3dxof_dump)) { static USHORT num; char tmp[12]; HANDLE file; sprintf(tmp, "file%05u.x", num++); file = CreateFileA(tmp, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL); if (file != INVALID_HANDLE_VALUE) { WriteFile(file, file_buffer, file_size, &bytes_written, NULL); CloseHandle(file); } } object->pDirectXFile = This; object->buf.pdxf = This; object->buf.token_present = FALSE; object->buf.buffer = file_buffer; object->buf.rem_bytes = file_size; hr = parse_header(&object->buf, &object->decomp_buffer); if (FAILED(hr)) goto error; /* Check if there are templates defined before the object */ if (!parse_templates(&object->buf, TRUE)) { hr = DXFILEERR_PARSEERROR; goto error; } if (TRACE_ON(d3dxof)) { ULONG i; TRACE("Registered templates (%d):\n", This->nb_xtemplates); for (i = 1; i < This->nb_xtemplates; i++) DPRINTF("%s - %s\n", This->xtemplates[i].name, debugstr_guid(&This->xtemplates[i].class_id)); } *ppEnumObj = &object->IDirectXFileEnumObject_iface; return DXFILE_OK; error: IDirectXFileEnumObject_Release(&object->IDirectXFileEnumObject_iface); *ppEnumObj = NULL; return hr; }
/*********************************************************************** * OutputDebugStringA (KERNEL32.@) * * Output by an application of an ascii string to a debugger (if attached) * and program log. * * PARAMS * str [I] The message to be logged and given to the debugger. * * RETURNS * * Nothing. */ void WINAPI OutputDebugStringA( LPCSTR str ) { static HANDLE DBWinMutex = NULL; static BOOL mutex_inited = FALSE; BOOL caught_by_dbg = TRUE; if (!str) str = ""; WARN("%s\n", debugstr_a(str)); /* raise exception, WaitForDebugEvent() will generate a corresponding debug event */ __TRY { ULONG_PTR args[2]; args[0] = strlen(str) + 1; args[1] = (ULONG_PTR)str; RaiseException( DBG_PRINTEXCEPTION_C, 0, 2, args ); } __EXCEPT(debug_exception_handler) { caught_by_dbg = FALSE; } __ENDTRY if (caught_by_dbg) return; /* send string to a system-wide monitor */ if (!mutex_inited) { /* first call to OutputDebugString, initialize mutex handle */ static const WCHAR mutexname[] = {'D','B','W','i','n','M','u','t','e','x',0}; HANDLE mutex = CreateMutexExW( NULL, mutexname, 0, SYNCHRONIZE ); if (mutex) { if (InterlockedCompareExchangePointer( &DBWinMutex, mutex, 0 ) != 0) { /* someone beat us here... */ CloseHandle( mutex ); } } mutex_inited = TRUE; } if (DBWinMutex) { static const WCHAR shmname[] = {'D','B','W','I','N','_','B','U','F','F','E','R',0}; static const WCHAR eventbuffername[] = {'D','B','W','I','N','_','B','U','F','F','E','R','_','R','E','A','D','Y',0}; static const WCHAR eventdataname[] = {'D','B','W','I','N','_','D','A','T','A','_','R','E','A','D','Y',0}; HANDLE mapping; mapping = OpenFileMappingW( FILE_MAP_WRITE, FALSE, shmname ); if (mapping) { LPVOID buffer; HANDLE eventbuffer, eventdata; buffer = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 0 ); eventbuffer = OpenEventW( SYNCHRONIZE, FALSE, eventbuffername ); eventdata = OpenEventW( EVENT_MODIFY_STATE, FALSE, eventdataname ); if (buffer && eventbuffer && eventdata) { /* monitor is present, synchronize with other OutputDebugString invocations */ WaitForSingleObject( DBWinMutex, INFINITE ); /* acquire control over the buffer */ if (WaitForSingleObject( eventbuffer, 10000 ) == WAIT_OBJECT_0) { int str_len; struct _mon_buffer_t { DWORD pid; char buffer[1]; } *mon_buffer = (struct _mon_buffer_t*) buffer; str_len = strlen( str ); if (str_len > (4096 - sizeof(DWORD) - 1)) str_len = 4096 - sizeof(DWORD) - 1; mon_buffer->pid = GetCurrentProcessId(); memcpy( mon_buffer->buffer, str, str_len ); mon_buffer->buffer[str_len] = 0; /* signal data ready */ SetEvent( eventdata ); } ReleaseMutex( DBWinMutex ); } if (buffer) UnmapViewOfFile( buffer ); if (eventbuffer) CloseHandle( eventbuffer ); if (eventdata) CloseHandle( eventdata ); CloseHandle( mapping ); } } }
/************************************************************ * WTSQueryUserConfigA (WTSAPI32.@) */ BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR *ppBuffer, DWORD *pBytesReturned) { FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass, ppBuffer, pBytesReturned); return FALSE; }
static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) { FILE_IN_CABINET_INFO_A fici; PSC_HSC_A phsc; CABINET_INFO_A ci; FILEPATHS_A fp; UINT err; CHAR mysterio[SIZEOF_MYSTERIO]; /* how big? undocumented! probably 256... */ memset(&(mysterio[0]), 0, SIZEOF_MYSTERIO); TRACE("(fdint == %d, pfdin == ^%p)\n", fdint, pfdin); if (pfdin && pfdin->pv && (*((void **) pfdin->pv) == (void *)SC_HSC_A_MAGIC)) phsc = pfdin->pv; else { ERR("pv %p is not an SC_HSC_A.\n", (pfdin) ? pfdin->pv : NULL); return -1; } switch (fdint) { case fdintCABINET_INFO: TRACE("Cabinet info notification\n"); /* TRACE(" Cabinet name: %s\n", debugstr_a(pfdin->psz1)); TRACE(" Cabinet disk: %s\n", debugstr_a(pfdin->psz2)); TRACE(" Cabinet path: %s\n", debugstr_a(pfdin->psz3)); TRACE(" Cabinet Set#: %d\n", pfdin->setID); TRACE(" Cabinet Cab#: %d\n", pfdin->iCabinet); */ WARN("SPFILENOTIFY_CABINETINFO undocumented: guess implementation.\n"); ci.CabinetFile = &(phsc->most_recent_cabinet_name[0]); ci.CabinetPath = pfdin->psz3; ci.DiskName = pfdin->psz2; ci.SetId = pfdin->setID; ci.CabinetNumber = pfdin->iCabinet; phsc->msghandler(phsc->context, SPFILENOTIFY_CABINETINFO, (UINT_PTR) &ci, 0); return 0; case fdintPARTIAL_FILE: TRACE("Partial file notification\n"); /* TRACE(" Partial file name: %s\n", debugstr_a(pfdin->psz1)); */ return 0; case fdintCOPY_FILE: TRACE("Copy file notification\n"); TRACE(" File name: %s\n", debugstr_a(pfdin->psz1)); /* TRACE(" File size: %ld\n", pfdin->cb); TRACE(" File date: %u\n", pfdin->date); TRACE(" File time: %u\n", pfdin->time); TRACE(" File attr: %u\n", pfdin->attribs); */ fici.NameInCabinet = pfdin->psz1; fici.FileSize = pfdin->cb; fici.Win32Error = 0; fici.DosDate = pfdin->date; fici.DosTime = pfdin->time; fici.DosAttribs = pfdin->attribs; memset(&(fici.FullTargetName[0]), 0, MAX_PATH); err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEINCABINET, (UINT_PTR)&fici, (UINT_PTR)pfdin->psz1); if (err == FILEOP_DOIT) { TRACE(" Callback specified filename: %s\n", debugstr_a(&(fici.FullTargetName[0]))); if (!fici.FullTargetName[0]) { WARN(" Empty return string causing abort.\n"); SetLastError(ERROR_PATH_NOT_FOUND); return -1; } return sc_cb_open(&(fici.FullTargetName[0]), _O_BINARY | _O_CREAT | _O_WRONLY, _S_IREAD | _S_IWRITE); } else { TRACE(" Callback skipped file.\n"); return 0; } case fdintCLOSE_FILE_INFO: TRACE("Close file notification\n"); /* TRACE(" File name: %s\n", debugstr_a(pfdin->psz1)); TRACE(" Exec file? %s\n", (pfdin->cb) ? "Yes" : "No"); TRACE(" File hndl: %d\n", pfdin->hf); */ fp.Source = &(phsc->most_recent_cabinet_name[0]); fp.Target = pfdin->psz1; fp.Win32Error = 0; fp.Flags = 0; /* the following should be a fixme -- but it occurs too many times */ WARN("Should set file date/time/attribs (and execute files?)\n"); err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEEXTRACTED, (UINT_PTR)&fp, 0); if (sc_cb_close(pfdin->hf)) WARN("_close failed.\n"); if (err) { SetLastError(err); return FALSE; } else return TRUE; case fdintNEXT_CABINET: TRACE("Next cabinet notification\n"); /* TRACE(" Cabinet name: %s\n", debugstr_a(pfdin->psz1)); TRACE(" Cabinet disk: %s\n", debugstr_a(pfdin->psz2)); TRACE(" Cabinet path: %s\n", debugstr_a(pfdin->psz3)); TRACE(" Cabinet Set#: %d\n", pfdin->setID); TRACE(" Cabinet Cab#: %d\n", pfdin->iCabinet); */ ci.CabinetFile = pfdin->psz1; ci.CabinetPath = pfdin->psz3; ci.DiskName = pfdin->psz2; ci.SetId = pfdin->setID; ci.CabinetNumber = pfdin->iCabinet; /* remember the new cabinet name */ strcpy(&(phsc->most_recent_cabinet_name[0]), pfdin->psz1); err = phsc->msghandler(phsc->context, SPFILENOTIFY_NEEDNEWCABINET, (UINT_PTR)&ci, (UINT_PTR)mysterio); if (err) { SetLastError(err); return -1; } else { if (mysterio[0]) { /* some easy paranoia. no such carefulness exists on the wide API IIRC */ lstrcpynA(pfdin->psz3, &(mysterio[0]), SIZEOF_MYSTERIO); } return 0; } default: FIXME("Unknown notification type %d.\n", fdint); return 0; } }
/************************************************************ * WTSSendMessageA (WTSAPI32.@) */ BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait) { FIXME("Stub %p 0x%08x (%s) %d (%s) %d 0x%08x %d %p %d\n", hServer, SessionId, debugstr_a(pTitle), TitleLength, debugstr_a(pMessage), MessageLength, Style, Timeout, pResponse, bWait); return FALSE; }
/****************************************************************************** * ControlTraceA [ADVAPI32.@] * * See ControlTraceW. * */ ULONG WINAPI ControlTraceA( TRACEHANDLE hSession, LPCSTR SessionName, PEVENT_TRACE_PROPERTIES Properties, ULONG control ) { FIXME("(%s, %s, %p, %d) stub\n", wine_dbgstr_longlong(hSession), debugstr_a(SessionName), Properties, control); return ERROR_SUCCESS; }
/************************************************************ * WTSSetUserConfigA (WTSAPI32.@) */ BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength) { FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,pBuffer, DataLength); return FALSE; }
/****************************************************************************** * StopTraceA [ADVAPI32.@] * * See StopTraceW. * */ ULONG WINAPI StopTraceA( TRACEHANDLE session, LPCSTR session_name, PEVENT_TRACE_PROPERTIES properties ) { FIXME("(%s, %s, %p) stub\n", wine_dbgstr_longlong(session), debugstr_a(session_name), properties); return ERROR_SUCCESS; }
/************************************************************ * WTSStartRemoteControlSessionA (WTSAPI32.@) */ BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) { FIXME("Stub (%s) %d %d %d\n", debugstr_a(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers); return FALSE; }
/*********************************************************************** * RunHTMLApplication (MSHTML.@) * * Appears to have the same prototype as WinMain. */ HRESULT WINAPI RunHTMLApplication( HINSTANCE hinst, HINSTANCE hPrevInst, LPSTR szCmdLine, INT nCmdShow ) { FIXME("%p %p %s %d\n", hinst, hPrevInst, debugstr_a(szCmdLine), nCmdShow ); return 0; }
/************************************************************ * WTSVirtualChannelOpen (WTSAPI32.@) */ HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName) { FIXME("Stub %p %d (%s)\n", hServer, SessionId, debugstr_a(pVirtualName)); return NULL; }
/*********************************************************************** * MapFileAndCheckSumA (IMAGEHLP.@) */ DWORD WINAPI MapFileAndCheckSumA( LPSTR Filename, LPDWORD HeaderSum, LPDWORD CheckSum) { HANDLE hFile; HANDLE hMapping; LPVOID BaseAddress; DWORD FileLength; TRACE("(%s, %p, %p): stub\n", debugstr_a(Filename), HeaderSum, CheckSum ); hFile = CreateFileA(Filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (hFile == INVALID_HANDLE_VALUE) { return CHECKSUM_OPEN_FAILURE; } hMapping = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL); if (hMapping == 0) { CloseHandle(hFile); return CHECKSUM_MAP_FAILURE; } BaseAddress = MapViewOfFile(hMapping, FILE_MAP_READ, 0, 0, 0); if (BaseAddress == 0) { CloseHandle(hMapping); CloseHandle(hFile); return CHECKSUM_MAPVIEW_FAILURE; } FileLength = GetFileSize(hFile, NULL); CheckSumMappedFile(BaseAddress, FileLength, HeaderSum, CheckSum); UnmapViewOfFile(BaseAddress); CloseHandle(hMapping); CloseHandle(hFile); return 0; }
/************************************************************ * WTSVirtualChannelOpen (WTSAPI32.@) */ HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags) { FIXME("Stub %d (%s) %d\n", SessionId, debugstr_a(pVirtualName), flags); return NULL; }
/*********************************************************************** * RpcEpUnregister (RPCRT4.@) */ RPC_STATUS WINAPI RpcEpUnregister( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector, UUID_VECTOR *UuidVector ) { PRPC_SERVER_INTERFACE If = IfSpec; ULONG i; RPC_STATUS status = RPC_S_OK; error_status_t status2; ept_entry_t *entries; handle_t handle; TRACE("(%p,%p,%p)\n", IfSpec, BindingVector, UuidVector); TRACE(" ifid=%s\n", debugstr_guid(&If->InterfaceId.SyntaxGUID)); for (i=0; i<BindingVector->Count; i++) { RpcBinding* bind = BindingVector->BindingH[i]; TRACE(" protseq[%d]=%s\n", i, debugstr_a(bind->Protseq)); TRACE(" endpoint[%d]=%s\n", i, debugstr_a(bind->Endpoint)); } if (UuidVector) { for (i=0; i<UuidVector->Count; i++) TRACE(" obj[%d]=%s\n", i, debugstr_guid(UuidVector->Uuid[i])); } entries = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*entries) * BindingVector->Count * (UuidVector ? UuidVector->Count : 1)); if (!entries) return RPC_S_OUT_OF_MEMORY; status = get_epm_handle_server(&handle); if (status != RPC_S_OK) { HeapFree(GetProcessHeap(), 0, entries); return status; } for (i = 0; i < BindingVector->Count; i++) { unsigned j; RpcBinding* bind = BindingVector->BindingH[i]; for (j = 0; j < (UuidVector ? UuidVector->Count : 1); j++) { status = TowerConstruct(&If->InterfaceId, &If->TransferSyntax, bind->Protseq, bind->Endpoint, bind->NetworkAddr, &entries[i*(UuidVector ? UuidVector->Count : 1) + j].tower); if (status != RPC_S_OK) break; if (UuidVector) memcpy(&entries[i * UuidVector->Count + j].object, &UuidVector->Uuid[j], sizeof(GUID)); else memset(&entries[i].object, 0, sizeof(entries[i].object)); } } if (status == RPC_S_OK) { __TRY { ept_insert(handle, BindingVector->Count * (UuidVector ? UuidVector->Count : 1), entries, TRUE, &status2); } __EXCEPT(rpc_filter) { status2 = GetExceptionCode(); } __ENDTRY if (status2 == RPC_S_SERVER_UNAVAILABLE) status2 = EPT_S_NOT_REGISTERED; if (status2 != RPC_S_OK) ERR("ept_insert failed with error %d\n", status2); status = status2; /* FIXME: convert status? */ }
/************************************************************ * WTSConnectSessionA (WTSAPI32.@) */ BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait) { FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_a(pPassword), bWait); return TRUE; }
/*********************************************************************** * OutputDebugStringA (KERNEL32.@) * * Output by an application of an ascii string to a debugger (if attached) * and program log. * * PARAMS * str [I] The message to be logged and given to the debugger. * * RETURNS * * Nothing. */ void WINAPI OutputDebugStringA( LPCSTR str ) { static HANDLE DBWinMutex = NULL; static BOOL mutex_inited = FALSE; if (!str) str = ""; /* send string to attached debugger */ SERVER_START_REQ( output_debug_string ) { req->string = wine_server_client_ptr( str ); req->length = strlen(str) + 1; wine_server_call( req ); } SERVER_END_REQ; WARN("%s\n", debugstr_a(str)); /* send string to a system-wide monitor */ /* FIXME should only send to monitor if no debuggers are attached */ if (!mutex_inited) { /* first call to OutputDebugString, initialize mutex handle */ static const WCHAR mutexname[] = {'D','B','W','i','n','M','u','t','e','x',0}; HANDLE mutex = CreateMutexExW( NULL, mutexname, 0, SYNCHRONIZE ); if (mutex) { if (InterlockedCompareExchangePointer( &DBWinMutex, mutex, 0 ) != 0) { /* someone beat us here... */ CloseHandle( mutex ); } } mutex_inited = TRUE; } if (DBWinMutex) { static const WCHAR shmname[] = {'D','B','W','I','N','_','B','U','F','F','E','R',0}; static const WCHAR eventbuffername[] = {'D','B','W','I','N','_','B','U','F','F','E','R','_','R','E','A','D','Y',0}; static const WCHAR eventdataname[] = {'D','B','W','I','N','_','D','A','T','A','_','R','E','A','D','Y',0}; HANDLE mapping; mapping = OpenFileMappingW( FILE_MAP_WRITE, FALSE, shmname ); if (mapping) { LPVOID buffer; HANDLE eventbuffer, eventdata; buffer = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 0 ); eventbuffer = OpenEventW( SYNCHRONIZE, FALSE, eventbuffername ); eventdata = OpenEventW( EVENT_MODIFY_STATE, FALSE, eventdataname ); if (buffer && eventbuffer && eventdata) { /* monitor is present, synchronize with other OutputDebugString invocations */ WaitForSingleObject( DBWinMutex, INFINITE ); /* acquire control over the buffer */ if (WaitForSingleObject( eventbuffer, 10000 ) == WAIT_OBJECT_0) { int str_len; struct _mon_buffer_t { DWORD pid; char buffer[1]; } *mon_buffer = (struct _mon_buffer_t*) buffer; str_len = strlen( str ); if (str_len > (4096 - sizeof(DWORD) - 1)) str_len = 4096 - sizeof(DWORD) - 1; mon_buffer->pid = GetCurrentProcessId(); memcpy( mon_buffer->buffer, str, str_len ); mon_buffer->buffer[str_len] = 0; /* signal data ready */ SetEvent( eventdata ); } ReleaseMutex( DBWinMutex ); } if (buffer) UnmapViewOfFile( buffer ); if (eventbuffer) CloseHandle( eventbuffer ); if (eventdata) CloseHandle( eventdata ); CloseHandle( mapping ); } } }
/*********************************************************************** * AtlAxDialogBoxA [atl100.36] * */ INT_PTR WINAPI AtlAxDialogBoxA(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, LPARAM dwInitParam) { FIXME("(%p %s %p %p %lx)\n", hInstance, debugstr_a(lpTemplateName), hWndParent, lpDialogProc, dwInitParam); return 0; }