ULONG AsyncIo( PVOID ThreadParameter ); BOOLEAN PerformWriteReadTest( IN HANDLE hDevice, IN ULONG TestLength ); BOOL GetDevicePath( IN LPGUID InterfaceGuid, _Out_writes_(BufLen) PCHAR DevicePath, _In_ size_t BufLen ); int __cdecl main( _In_ int argc, _In_reads_(argc) char* argv[] ) { HANDLE hDevice = INVALID_HANDLE_VALUE; HANDLE th1 = NULL; BOOLEAN result = TRUE;
HRESULT CreateComputeShader(_In_z_ LPCWSTR pSrcFile, _In_z_ LPCSTR pFunctionName, _In_ ID3D11Device* pDevice, _Outptr_ ID3D11ComputeShader** ppShaderOut); HRESULT CreateStructuredBuffer(_In_ ID3D11Device* pDevice, _In_ UINT uElementSize, _In_ UINT uCount, _In_reads_(uElementSize*uCount) void* pInitData, _Outptr_ ID3D11Buffer** ppBufOut); HRESULT CreateRawBuffer(_In_ ID3D11Device* pDevice, _In_ UINT uSize, _In_reads_(uSize) void* pInitData, _Outptr_ ID3D11Buffer** ppBufOut); HRESULT CreateBufferSRV(_In_ ID3D11Device* pDevice, _In_ ID3D11Buffer* pBuffer, _Outptr_ ID3D11ShaderResourceView** ppSRVOut); HRESULT CreateBufferUAV(_In_ ID3D11Device* pDevice, _In_ ID3D11Buffer* pBuffer, _Outptr_ ID3D11UnorderedAccessView** pUAVOut); ID3D11Buffer* CreateAndCopyToDebugBuf(_In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext* pd3dImmediateContext, _In_ ID3D11Buffer* pBuffer); void RunComputeShader(_In_ ID3D11DeviceContext* pd3dImmediateContext, _In_ ID3D11ComputeShader* pComputeShader, _In_ UINT nNumViews, _In_reads_(nNumViews) ID3D11ShaderResourceView** pShaderResourceViews, _In_opt_ ID3D11Buffer* pCBCS, _In_reads_opt_(dwNumDataBytes) void* pCSData, _In_ DWORD dwNumDataBytes, _In_ ID3D11UnorderedAccessView* pUnorderedAccessView, _In_ UINT X, _In_ UINT Y, _In_ UINT Z); HRESULT FindDXSDKShaderFileCch(_Out_writes_(cchDest) WCHAR* strDestPath, _In_ int cchDest, _In_z_ LPCWSTR strFilename); //-------------------------------------------------------------------------------------- // Running DEBUG in VS, wait for key //-------------------------------------------------------------------------------------- inline int returnDBG(int val) { #ifdef _DEBUG getchar(); #endif return val; } //--------------------------------------------------------------------------------------
#include "Globals.h" //--------------------------------------------------------------------- // // CLSIDToString // //--------------------------------------------------------------------- const BYTE GuidSymbols[] = { 3, 2, 1, 0, '-', 5, 4, '-', 7, 6, '-', 8, 9, '-', 10, 11, 12, 13, 14, 15 }; const WCHAR HexDigits[] = L"0123456789ABCDEF"; BOOL CLSIDToString(REFGUID refGUID, _Out_writes_(39) WCHAR *pCLSIDString) { WCHAR* pTemp = pCLSIDString; const BYTE* pBytes = (const BYTE *) &refGUID; DWORD j = 0; pTemp[j++] = L'{'; for (int i = 0; i < sizeof(GuidSymbols) && j < (CLSID_STRLEN - 2); i++) { if (GuidSymbols[i] == '-') { pTemp[j++] = L'-'; } else { pTemp[j++] = HexDigits[ (pBytes[GuidSymbols[i]] & 0xF0) >> 4 ];
#define UNICODE #define _UNICODE #include <windows.h> #include <winioctl.h> #include <tchar.h> #include <stdio.h> #include "drvioctl.h" #include "install.h" #include <conio.h> #include <strsafe.h> #define WAIT_TIME 10 BOOLEAN SetupDriverName( _Out_writes_(MAX_PATH)LPTSTR DriverLocation ); int _cdecl main(int argc, LPCTSTR argv[]) { HANDLE hDevice; // handle to a device, file, or directory DWORD dwError = ERROR_SUCCESS; LPVOID lpFileName = _T("\\\\.\\TraceKmp") ; TCHAR driverLocation[MAX_PATH]; DWORD dwOutBuffer[2048]; DWORD dwOutBufferCount ; int ch; UNREFERENCED_PARAMETER(argc); UNREFERENCED_PARAMETER(argv);
#include "stdafx.h" #ifdef __cplusplus extern "C" { #endif SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, _Out_writes_(_Inexpressible_(BufferLength)) SQLPOINTER Value, SQLINTEGER BufferLength, _Out_opt_ SQLINTEGER *StringLength) { AQ_ODBC_LOG("%s called\n", __FUNCTION__); return SQL_SUCCESS; } SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, _Out_writes_opt_(_Inexpressible_(BufferLength)) SQLPOINTER Value, SQLINTEGER BufferLength, _Out_opt_ SQLINTEGER *StringLength) { AQ_ODBC_LOG("%s called\n", __FUNCTION__); AqHandleStmt * hstmt = (AqHandleStmt *)StatementHandle; AQ_ODBC_LOG("hstmt id: [%d]\n", hstmt->Stmt); switch ( Attribute ) { case SQL_ATTR_APP_PARAM_DESC: AQ_ODBC_LOG("SQL_ATTR_APP_PARAM_DESC\n"); *((SQLINTEGER*)Value) = (SQLINTEGER)&(((AqHandleStmt *)StatementHandle)->apd); break;
PULONG GuidIndex ); NTSTATUS ClassQueryInternalDataBlock( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG BufferAvail, OUT PUCHAR Buffer ); PWCHAR ConvertTickToDateTime( IN LARGE_INTEGER Tick, _Out_writes_(TIME_STRING_LENGTH) PWCHAR String ); BOOLEAN ClassFindInternalGuid( LPGUID Guid, PULONG GuidIndex ); // // This is the name for the MOF resource that must be part of all drivers that // register via this interface. #define MOFRESOURCENAME L"MofResourceName" //
maxProcessRecord->ProcessName->Buffer, maxCpuUsage * 100 ); } #else maxUsageString = PhaConcatStrings2(L"\n", maxProcessRecord->ProcessName->Buffer); #endif PhDereferenceProcessRecord(maxProcessRecord); } return maxUsageString; } VOID PhSipGetCpuBrandString( _Out_writes_(49) PWSTR BrandString ) { ULONG brandString[4 * 3]; __cpuid(&brandString[0], 0x80000002); __cpuid(&brandString[4], 0x80000003); __cpuid(&brandString[8], 0x80000004); PhZeroExtendToUtf16Buffer((PSTR)brandString, 48, BrandString); BrandString[48] = 0; } BOOLEAN PhSipGetCpuFrequencyFromDistribution( _Out_ DOUBLE *Fraction )
Environment: - User mode Revision History: - Matthieu Suiche --*/ #include "stdafx.h" #include "SwishDbgExt.h" PSTR GetISO8601Date( _Out_writes_(Length) PSTR Buffer, _In_ ULONG Length, _In_ PFILETIME FileTime ) { SYSTEMTIME SystemTime; Buffer[0] = '\0'; if ((FileTime->dwHighDateTime || FileTime->dwLowDateTime) && FileTimeToSystemTime(FileTime, &SystemTime)) { StringCchPrintfA(Buffer, Length, "%i-%02i-%02iT%02i:%02i:%02i.%03iZ", SystemTime.wYear, SystemTime.wMonth,
// #include <corecrt_internal_securecrt.h> #include <corecrt_internal_time.h> #define _ASCBUFSIZE 26 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // // asctime_s and _wasctime_s // //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ template <typename Character> static Character* __cdecl common_asctime_s_write_value( _Out_writes_(2) Character* p, int const value, bool const zero_fill ) throw() { if (value >= 10 || zero_fill) { *p++ = static_cast<Character>('0' + value / 10); } else { *p++ = ' '; } *p++ = static_cast<Character>('0' + value % 10); return p;
} else if (wch == THIRDPARTY_PREVPAGE) { vkRet = VK_PRIOR; } } return vkRet; } //+--------------------------------------------------------------------------- // // _IsKeyEaten // //---------------------------------------------------------------------------- BOOL CDIME::_IsKeyEaten(_In_ ITfContext *pContext, UINT codeIn, _Out_ UINT *pCodeOut, _Out_writes_(1) WCHAR *pwch, _Inout_opt_ _KEYSTROKE_STATE *pKeyState) { debugPrint(L"CDIME::_IsKeyEaten(), codein = %d", codeIn); pContext; *pCodeOut = codeIn; BOOL isOpen = FALSE; CCompartment CompartmentKeyboardOpen(_pThreadMgr, _tfClientId, Global::DIMEGuidCompartmentIMEMode); CompartmentKeyboardOpen._GetCompartmentBOOL(isOpen); BOOL isDoubleSingleByte = FALSE; CCompartment CompartmentDoubleSingleByte(_pThreadMgr, _tfClientId, Global::DIMEGuidCompartmentDoubleSingleByte); CompartmentDoubleSingleByte._GetCompartmentBOOL(isDoubleSingleByte);
} } PhFree(displayToText); PhFree(displayToId); lines = PhaFormatTextTable(table, rows, columns, Mode); PhDeleteAutoPool(&autoPool); return lines; } VOID PhaMapDisplayIndexListView( _In_ HWND ListViewHandle, _Out_writes_(Count) PULONG DisplayToId, _Out_writes_opt_(Count) PPH_STRING *DisplayToText, _In_ ULONG Count, _Out_ PULONG NumberOfColumns ) { LVCOLUMN lvColumn; ULONG i; ULONG count; WCHAR buffer[128]; count = 0; lvColumn.mask = LVCF_ORDER | LVCF_TEXT; lvColumn.pszText = buffer; lvColumn.cchTextMax = sizeof(buffer) / sizeof(WCHAR);
_In_ ULONG EstimatedTime ); _Must_inspect_result_ _Success_(return==STATUS_SUCCESS) NTSTATUS SimBattSetBatteryTemperature ( _In_ WDFDEVICE Device, _In_ ULONG Temperature ); _Success_(return==STATUS_SUCCESS) NTSTATUS SimBattSetBatteryString ( _In_ PCWSTR String, _Out_writes_(MAX_BATTERY_STRING_SIZE) PWCHAR Destination ); _Must_inspect_result_ _Success_(return==STATUS_SUCCESS) NTSTATUS SimBattGetBatteryMaxChargingCurrent ( _In_ WDFDEVICE Device, _Out_ PULONG MaxChargingCurrent ); _Must_inspect_result_ _Success_(return==STATUS_SUCCESS) NTSTATUS GetSimBattStateFromRegistry ( _In_ WDFDEVICE Device,
); PPH_OBJECT_TYPE PhMemoryItemType; BOOLEAN PhMemoryProviderInitialization( VOID ) { PhMemoryItemType = PhCreateObjectType(L"MemoryItem", 0, PhpMemoryItemDeleteProcedure); return TRUE; } VOID PhGetMemoryProtectionString( _In_ ULONG Protection, _Out_writes_(17) PWSTR String ) { PWSTR string; PH_STRINGREF base; if (!Protection) { String[0] = 0; return; } if (Protection & PAGE_NOACCESS) PhInitializeStringRef(&base, L"NA"); else if (Protection & PAGE_READONLY) PhInitializeStringRef(&base, L"R");
UpdateSubresources<1>(m_commandList.Get(), m_vertexBuffer.Get(), m_vertexBufferUpload.Get(), 0, 0, 1, &vertexData); m_commandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(m_vertexBuffer.Get(), D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER)); m_vertexBufferView.BufferLocation = m_vertexBuffer->GetGPUVirtualAddress(); m_vertexBufferView.SizeInBytes = static_cast<UINT>(bufferSize); m_vertexBufferView.StrideInBytes = sizeof(ParticleVertex); } // Random percent value, from -1 to 1. float D3D12nBodyGravity::RandomPercent() { float ret = static_cast<float>((rand() % 10000) - 5000); return ret / 5000.0f; } void D3D12nBodyGravity::LoadParticles(_Out_writes_(numParticles) Particle* pParticles, const XMFLOAT3& center, const XMFLOAT4& velocity, float spread, UINT numParticles) { srand(0); for (UINT i = 0; i < numParticles; i++) { XMFLOAT3 delta(spread, spread, spread); while (XMVectorGetX(XMVector3LengthSq(XMLoadFloat3(&delta))) > spread * spread) { delta.x = RandomPercent() * spread; delta.y = RandomPercent() * spread; delta.z = RandomPercent() * spread; } pParticles[i].position.x = center.x + delta.x; pParticles[i].position.y = center.y + delta.y;
LIGHT_ALL_BARS, CLEAR_ALL_BARS, GET_BAR_GRAPH_LIGHT_STATE, GET_SWITCH_STATE, GET_SWITCH_STATE_AS_INTERRUPT_MESSAGE, GET_7_SEGEMENT_STATE, SET_7_SEGEMENT_STATE, RESET_DEVICE, REENUMERATE_DEVICE, } INPUT_FUNCTION; _Success_ (return != FALSE) BOOL GetDevicePath( IN LPGUID InterfaceGuid, _Out_writes_(BufLen) PWSTR DevicePath, _In_ size_t BufLen ) { HDEVINFO HardwareDeviceInfo; SP_DEVICE_INTERFACE_DATA DeviceInterfaceData; PSP_DEVICE_INTERFACE_DETAIL_DATA DeviceInterfaceDetailData = NULL; ULONG Length, RequiredLength = 0; BOOL bResult; HRESULT hr; HardwareDeviceInfo = SetupDiGetClassDevs( InterfaceGuid, NULL, NULL, (DIGCF_PRESENT | DIGCF_DEVICEINTERFACE));
#include <atlcom.h> #include <atlcoll.h> #include <atlsync.h> #include <mmreg.h> #include <audioenginebaseapo.h> #include <baseaudioprocessingobject.h> #include <resource.h> #include <float.h> #include "SwapAPO.h" #pragma AVRT_CODE_BEGIN void WriteSilence( _Out_writes_(u32FrameCount * u32SamplesPerFrame) FLOAT32 *pf32Frames, UINT32 u32FrameCount, UINT32 u32SamplesPerFrame ) { ZeroMemory(pf32Frames, sizeof(FLOAT32) * u32FrameCount * u32SamplesPerFrame); } #pragma AVRT_CODE_END #pragma AVRT_CODE_BEGIN void CopyFrames( _Out_writes_(u32FrameCount * u32SamplesPerFrame) FLOAT32 *pf32OutFrames, _In_reads_(u32FrameCount * u32SamplesPerFrame) const FLOAT32 *pf32InFrames, UINT32 u32FrameCount,