Retrieving Light Properties

You can retrieve the properties of an existing light object by calling its IDirect3DLight::GetLight method. When calling the GetLight method, you should pass the address of a D3DLIGHT2 structure cast as the LPD3DLIGHT data type, rather than the address of a D3DLIGHT structure. By passing the address of a D3DLIGHT2 structure, you ensure that there is enough memory available to accept the property information that the method copies to the provided structure from its internal data members. As with all structures in DirectX, always make sure to initialize the structure's dwSize member to the size of the structure, in bytes, before using it.