IDirect3DVertexShader9* vertexShader = nullptr; // assume that vertexShaderByteCode is a buffer containing the byte code of the vertex shader HRESULT hr = d3dDevice->CreateVertexShader(vertexShaderByteCode, &vertexShader); if (FAILED(hr)) { // handle error }This code creates a new vertex shader object using the CreateVertexShader function. It passes the byte code of the shader as the first parameter and the address of the vertex shader object as the second parameter. If the function call is successful, it returns S_OK, and the vertexShader pointer will be set to a valid object. The package library for this function is Direct3D 9.